- Timestamp:
- Aug 17, 2009, 10:03:53 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 14acbbd
- Parents:
- 8bce750
- git-author:
- Nelson Elhage <nelhage@mit.edu> (08/17/09 22:03:45)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (08/17/09 22:03:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
util.c
r8bce750 re30ed92 158 158 159 159 const char *skiptokens(const char *buff, int n) { 160 /* skips n tokens and returns where that would be. 161 * TODO: handle quotes more sanely. */ 162 163 int inquotes=0; 160 /* skips n tokens and returns where that would be. */ 161 char quote = 0; 164 162 while (*buff && n>0) { 165 163 while (*buff == ' ') buff++; 166 while (*buff && (inquotes || *buff != ' ')) { 167 if (*buff == '"' || *buff == '\'') inquotes=!inquotes; 168 buff++; 164 while (*buff && (quote || *buff != ' ')) { 165 if(quote) { 166 if(*buff == quote) quote = 0; 167 } else if(*buff == '"' || *buff == '\'') { 168 quote = *buff; 169 } 170 buff++; 169 171 } 170 172 while (*buff == ' ') buff++;
Note: See TracChangeset
for help on using the changeset viewer.