From 8a7769edb302a19e6e6083cc5cfd8a9d35e6ed9f Mon Sep 17 00:00:00 2001 From: Norbert Warmuth Date: Wed, 18 Aug 1999 04:53:18 +0000 Subject: [PATCH] 1999-08-18 Norbert Warmuth * vfs/sfs.c (vfmake): Quote characters with a special meaning to the shell in filenames/-pathes (Fix Bug #1931, VFS will not work if your full path has the space character in it.). --- vfs/ChangeLog | 6 ++++++ vfs/sfs.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 0cd233019..e25f94a17 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,9 @@ +1999-08-18 Norbert Warmuth + + * sfs.c (vfmake): Quote characters with a special meaning to the + shell in filenames/-pathes (Fix Bug #1931, VFS will not work if + your full path has the space character in it). + 1999-08-17 Kjartan Maraas * fish.c: Fix typo. diff --git a/vfs/sfs.c b/vfs/sfs.c index 814ab726f..7be66815e 100644 --- a/vfs/sfs.c +++ b/vfs/sfs.c @@ -65,12 +65,14 @@ static int vfmake (vfs *me, char *name, char *cache) if ((sfs_flags[w] & F_1) || (!strcmp (name, "/"))) ; else return -1; /* if ((sfs_flags[w] & F_2) || (!inpath) || (!*inpath)); else return -1; */ - if (!(sfs_flags[w] & F_NOLOCALCOPY)) - name = mc_getlocalcopy (name); - else - name = g_strdup (name); - if (!name) - return -1; + if (!(sfs_flags[w] & F_NOLOCALCOPY)) { + s = mc_getlocalcopy (name); + if (!s) + return -1; + name = name_quote (s, 0); + g_free (s); + } else + name = name_quote (name, 0); s = sfs_command[w]; #define COPY_CHAR if (t-pad>10200) return -1; else *t++ = *s; #define COPY_STRING(a) if ((t-pad)+strlen(a)>10200) return -1; else { strcpy (t, a); t+= strlen(a); }