]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Remove quotes from tokens to handle paths with spaces correctly.
authorCharlie Root <root@ntp.org>
Thu, 31 Mar 2005 09:15:14 +0000 (11:15 +0200)
committerCharlie Root <root@ntp.org>
Thu, 31 Mar 2005 09:15:14 +0000 (11:15 +0200)
bk: 424bbfa2HLHBwYA56ZzuxU6SrL9Flw

ntpd/ntp_config.c

index 29aca0ac4299a9cc778b3f0fca3e506b64e86c01..82d1f7f96c6ee46592eae996f5ade53e7eb176be 100644 (file)
@@ -2058,8 +2058,29 @@ gettokens (
                        if (ISEOL(*cp))
                                break;
                }
+               
+
        }
 
+
+       /* Heiko: Remove leading and trailing quotes around tokens */
+       {
+            int i,j = 0;
+           
+               
+           for (i = 0; i < ntok; i++) {            
+                /* Now check if the first char is a quote and remove that */
+                if ( tokenlist[ntok][0] == '"' )
+                        tokenlist[ntok]++;
+
+                /* Now check the last char ... */
+                j = strlen(tokenlist[ntok])-1;
+                if ( tokenlist[ntok][j] == '"' )
+                        tokenlist[ntok][j] = '\0';
+           }
+                                                       
+        }
+
        if (ntok == MAXTOKENS) {
                --ntok;
                /* HMS: chomp it to lose the EOL? */