1
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-11-28 05:04:36 +00:00
Lakka-LibreELEC/projects/L4T/devices/Switch/patches/rewritefs/rewritefs-hardcode-rewrite.patch
GavinDarkglider 3a8bf282c6
[WIP] More switch/l4t stuff (#1543)
* Update UCM, Add initial LibreELEC build changes, Add alsastate save/restore, remove old ffmpeg from switch builds
* Add mount to switch build for cheats
* Add support for nvmpi to new ffmpeg
* L4T/Switch: use Python3
* L4T: use upstream openssh package
* openssh: add Switch specific patch for keydir
* project/device options cleanup, typos, other fixes
* moonlight: move the core to lakka packages, build for other targets
* rearange a few patches
* L4T: use upstream xorg-server package
* L4T: use upstream libglvnd package
* L4T: use upstream mesa package
* L4T: use upstream util-linux package
* Remove xpadneo from L4T builds

Co-authored-by: Tomáš Kelemen (vudiq) <vudiq@vudiq.sk>
2021-11-20 12:19:31 +01:00

67 lines
1.6 KiB
Diff

diff --git a/rewrite.c b/rewrite.c
index acdc2f9..2c10f5f 100644
--- a/rewrite.c
+++ b/rewrite.c
@@ -531,8 +531,20 @@ char *rewrite(const char *path) {
struct rewrite_rule *rule;
char *caller = NULL;
+ char *newpath = strdup(path);
+
+ char *ch = newpath;
+ while (*ch != '\0')
+ {
+ if (*ch == ':')
+ *ch = '-';
+ ch++;
+ }
+
int res;
+ path = newpath;
+
DEBUG(3, "%s:\n", path);
for(ctx = config.contexts; ctx != NULL; ctx = ctx->next) {
@@ -568,5 +580,7 @@ char *rewrite(const char *path) {
}
free(caller);
- return apply_rule(path, NULL);
+ char* result = apply_rule(path, NULL);
+ free(newpath);
+ return result;
}
diff --git a/rewritefs.c b/rewritefs.c
index 736513d..30dd71f 100644
--- a/rewritefs.c
+++ b/rewritefs.c
@@ -164,8 +164,25 @@ static int rewrite_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
st.st_ino = d->entry->d_ino;
st.st_mode = d->entry->d_type << 12;
RLOCK(nextoff = telldir(d->dp));
- if (filler(buf, d->entry->d_name, &st, nextoff))
- break;
+ char *newname = strdup(d->entry->d_name);
+ char *ch = newname;
+ while (*ch != '\0')
+ {
+ if (*ch == '-')
+ *ch = ':';
+ ch++;
+ }
+ if (filler(buf, newname, &st, nextoff))
+ {
+ free(newname);
+ break;
+ }
+ else
+ {
+ free(newname);
+ break;
+ }
+
d->entry = NULL;
d->offset = nextoff;