Fix escape char problem.
authorEric Andersen <andersen@codepoet.org>
Thu, 30 Nov 2000 00:03:57 +0000 (00:03 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 30 Nov 2000 00:03:57 +0000 (00:03 -0000)
lash.c
sh.c
shell/lash.c

diff --git a/lash.c b/lash.c
index 7f5b9060207c30bb20c33de7a2e688c2948577d0..87d4fbfbd210d256c4b3d95dd182b570c8b1ee86 100644 (file)
--- a/lash.c
+++ b/lash.c
@@ -797,9 +797,13 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr,
                        /* we need to remove whatever \ quoting is still present */
                        src = dst = prog->argv[argc_l - 1];
                        while (*src) {
-                               if (*src != '\\')
+                               if (*src == '\\') {
+                                       src++; 
+                                       *dst++ = process_escape_sequence(&src);
+                               } else { 
                                        *dst++ = *src;
-                               src++;
+                                       src++;
+                               }
                        }
                        *dst = '\0';
                } else if (!rc) {
@@ -812,11 +816,16 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr,
        }else{
                        src = dst = prog->argv[argc_l - 1];
                        while (*src) {
-                               if (*src != '\\')
+                               if (*src == '\\') {
+                                       src++; 
+                                       *dst++ = process_escape_sequence(&src);
+                               } else { 
                                        *dst++ = *src;
-                               src++;
+                                       src++;
+                               }
                        }
                        *dst = '\0';
+                       
                        prog->globResult.gl_pathc=0;
                        if (flags==0)
                                prog->globResult.gl_pathv=NULL;
diff --git a/sh.c b/sh.c
index 7f5b9060207c30bb20c33de7a2e688c2948577d0..87d4fbfbd210d256c4b3d95dd182b570c8b1ee86 100644 (file)
--- a/sh.c
+++ b/sh.c
@@ -797,9 +797,13 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr,
                        /* we need to remove whatever \ quoting is still present */
                        src = dst = prog->argv[argc_l - 1];
                        while (*src) {
-                               if (*src != '\\')
+                               if (*src == '\\') {
+                                       src++; 
+                                       *dst++ = process_escape_sequence(&src);
+                               } else { 
                                        *dst++ = *src;
-                               src++;
+                                       src++;
+                               }
                        }
                        *dst = '\0';
                } else if (!rc) {
@@ -812,11 +816,16 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr,
        }else{
                        src = dst = prog->argv[argc_l - 1];
                        while (*src) {
-                               if (*src != '\\')
+                               if (*src == '\\') {
+                                       src++; 
+                                       *dst++ = process_escape_sequence(&src);
+                               } else { 
                                        *dst++ = *src;
-                               src++;
+                                       src++;
+                               }
                        }
                        *dst = '\0';
+                       
                        prog->globResult.gl_pathc=0;
                        if (flags==0)
                                prog->globResult.gl_pathv=NULL;
index 7f5b9060207c30bb20c33de7a2e688c2948577d0..87d4fbfbd210d256c4b3d95dd182b570c8b1ee86 100644 (file)
@@ -797,9 +797,13 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr,
                        /* we need to remove whatever \ quoting is still present */
                        src = dst = prog->argv[argc_l - 1];
                        while (*src) {
-                               if (*src != '\\')
+                               if (*src == '\\') {
+                                       src++; 
+                                       *dst++ = process_escape_sequence(&src);
+                               } else { 
                                        *dst++ = *src;
-                               src++;
+                                       src++;
+                               }
                        }
                        *dst = '\0';
                } else if (!rc) {
@@ -812,11 +816,16 @@ static void globLastArgument(struct childProgram *prog, int *argcPtr,
        }else{
                        src = dst = prog->argv[argc_l - 1];
                        while (*src) {
-                               if (*src != '\\')
+                               if (*src == '\\') {
+                                       src++; 
+                                       *dst++ = process_escape_sequence(&src);
+                               } else { 
                                        *dst++ = *src;
-                               src++;
+                                       src++;
+                               }
                        }
                        *dst = '\0';
+                       
                        prog->globResult.gl_pathc=0;
                        if (flags==0)
                                prog->globResult.gl_pathv=NULL;