getsubopt.c (1574) | getsubopt.c (8870) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 66 unchanged lines hidden (view full) --- 75 * If there's an equals sign, set the value pointer, and 76 * skip over the value part of the token. Terminate the 77 * token. 78 */ 79 if (*p == '=') { 80 *p = '\0'; 81 for (*valuep = ++p; 82 *p && *p != ',' && *p != ' ' && *p != '\t'; ++p); | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 66 unchanged lines hidden (view full) --- 75 * If there's an equals sign, set the value pointer, and 76 * skip over the value part of the token. Terminate the 77 * token. 78 */ 79 if (*p == '=') { 80 *p = '\0'; 81 for (*valuep = ++p; 82 *p && *p != ',' && *p != ' ' && *p != '\t'; ++p); |
83 if (*p) | 83 if (*p) |
84 *p++ = '\0'; 85 } else 86 *p++ = '\0'; 87 /* Skip any whitespace or commas after this token. */ 88 for (; *p && (*p == ',' || *p == ' ' || *p == '\t'); ++p); 89 } 90 91 /* set optionp for next round. */ 92 *optionp = p; 93 94 for (cnt = 0; *tokens; ++tokens, ++cnt) 95 if (!strcmp(suboptarg, *tokens)) 96 return(cnt); 97 return(-1); 98} | 84 *p++ = '\0'; 85 } else 86 *p++ = '\0'; 87 /* Skip any whitespace or commas after this token. */ 88 for (; *p && (*p == ',' || *p == ' ' || *p == '\t'); ++p); 89 } 90 91 /* set optionp for next round. */ 92 *optionp = p; 93 94 for (cnt = 0; *tokens; ++tokens, ++cnt) 95 if (!strcmp(suboptarg, *tokens)) 96 return(cnt); 97 return(-1); 98} |