Mercurial > hg > octave-jordi > gnulib-hg
comparison lib/getsubopt.c @ 12421:e8d2c6fc33ad
Use spaces for indentation, not tabs.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 10 Dec 2009 20:28:30 +0100 |
parents | bbbbbf4cd1c5 |
children | b5e42ef33b49 |
comparison
equal
deleted
inserted
replaced
12420:5850b9a81029 | 12421:e8d2c6fc33ad |
---|---|
56 | 56 |
57 /* Try to match the characters between *OPTIONP and VSTART against | 57 /* Try to match the characters between *OPTIONP and VSTART against |
58 one of the TOKENS. */ | 58 one of the TOKENS. */ |
59 for (cnt = 0; tokens[cnt] != NULL; ++cnt) | 59 for (cnt = 0; tokens[cnt] != NULL; ++cnt) |
60 if (strncmp (*optionp, tokens[cnt], vstart - *optionp) == 0 | 60 if (strncmp (*optionp, tokens[cnt], vstart - *optionp) == 0 |
61 && tokens[cnt][vstart - *optionp] == '\0') | 61 && tokens[cnt][vstart - *optionp] == '\0') |
62 { | 62 { |
63 /* We found the current option in TOKENS. */ | 63 /* We found the current option in TOKENS. */ |
64 *valuep = vstart != endp ? vstart + 1 : NULL; | 64 *valuep = vstart != endp ? vstart + 1 : NULL; |
65 | 65 |
66 if (*endp != '\0') | 66 if (*endp != '\0') |
67 *endp++ = '\0'; | 67 *endp++ = '\0'; |
68 *optionp = endp; | 68 *optionp = endp; |
69 | 69 |
70 return cnt; | 70 return cnt; |
71 } | 71 } |
72 | 72 |
73 /* The current suboption does not match any option. */ | 73 /* The current suboption does not match any option. */ |
74 *valuep = *optionp; | 74 *valuep = *optionp; |
75 | 75 |