Mercurial > hg > toybox
comparison toys/toysh.c @ 115:19b5567f0a1b
Add readlink, xreadlink(), and change xrealloc() to not fight the stupid
compiler so much.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 29 Apr 2007 19:55:21 -0400 |
parents | 7c77c6ec17ee |
children | 933766b0bd4b |
comparison
equal
deleted
inserted
replaced
114:ce6956dfc0cf | 115:19b5567f0a1b |
---|---|
59 (*cmd)->argv[(*cmd)->argc++] = xstrndup(start, end-start); | 59 (*cmd)->argv[(*cmd)->argc++] = xstrndup(start, end-start); |
60 | 60 |
61 // Allocate more space if there's no room for NULL terminator. | 61 // Allocate more space if there's no room for NULL terminator. |
62 | 62 |
63 if (!((*cmd)->argc & 7)) | 63 if (!((*cmd)->argc & 7)) |
64 xrealloc((void **)cmd, | 64 *cmd=xrealloc(*cmd, |
65 sizeof(struct command) + ((*cmd)->argc+8)*sizeof(char *)); | 65 sizeof(struct command) + ((*cmd)->argc+8)*sizeof(char *)); |
66 (*cmd)->argv[(*cmd)->argc] = 0; | 66 (*cmd)->argv[(*cmd)->argc] = 0; |
67 return end; | 67 return end; |
68 } | 68 } |
69 | 69 |