version 1.12, 2002/12/08 22:43:54 |
version 1.13, 2003/04/05 16:17:26 |
|
|
* Digit signifies an old-style option. Malloc space for dash, |
* Digit signifies an old-style option. Malloc space for dash, |
* new option and argument. |
* new option and argument. |
*/ |
*/ |
len = strlen(ap); |
len = strlen(ap) + 3; |
if ((start = p = malloc(len + 3)) == NULL) |
if ((start = p = malloc(len)) == NULL) |
err(1, "malloc"); |
err(1, "malloc"); |
*p++ = '-'; |
*p++ = '-'; |
*p++ = ap[0] == '+' ? 's' : 'f'; |
*p++ = ap[0] == '+' ? 's' : 'f'; |
(void)strcpy(p, ap + 1); |
(void)strlcpy(p, ap + 1, len - 2); |
*argv = start; |
*argv = start; |
} |
} |
} |
} |