fix, comb out double-/ hiccups in invocation-{name,directory}
authorSebastian Freundt <freundt@ga-group.nl>
Thu, 15 Mar 2012 17:03:56 +0000 (17:03 +0000)
committerSebastian Freundt <freundt@ga-group.nl>
Thu, 15 Mar 2012 18:19:45 +0000 (18:19 +0000)
Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
src/emacs.c

index 8a0db86..0aaffd8 100644 (file)
@@ -2237,6 +2237,16 @@ DOESNT_RETURN main_1(int argc, char **argv, char **envp, int restart)
                if (NILP(Vinvocation_directory))
                        Vinvocation_directory = Vinvocation_name;
 
+               /* kick double /s as we want a standard posix name */
+               for (unsigned char *p = XSTRING_DATA(Vinvocation_name),
+                            *q = p; ((*q = *p));) {
+                       if (*q++ == '/') {
+                               while (*++p == '/');
+                       } else {
+                               p++;
+                       }
+               }
+
                Vinvocation_name =
                    Ffile_name_nondirectory(Vinvocation_directory);
                Vinvocation_directory =