version 1.42, 2017/08/01 18:05:53 |
version 1.43, 2017/12/08 18:41:59 |
|
|
pledge_rpath = 1; |
pledge_rpath = 1; |
p++; |
p++; |
EATSPACE(); |
EATSPACE(); |
|
if (*p == '\0') |
|
error(COMPILE, "filename expected"); |
cmd->t = duptoeol(p, "read command", NULL); |
cmd->t = duptoeol(p, "read command", NULL); |
break; |
break; |
case BRANCH: /* b t */ |
case BRANCH: /* b t */ |
|
|
{ |
{ |
int gn; /* True if we have seen g or n */ |
int gn; /* True if we have seen g or n */ |
long l; |
long l; |
char wfile[PATH_MAX], *q, *eq; |
|
|
|
s->n = 1; /* Default */ |
s->n = 1; /* Default */ |
s->p = 0; |
s->p = 0; |
|
|
continue; |
continue; |
case 'w': |
case 'w': |
p++; |
p++; |
#ifdef HISTORIC_PRACTICE |
|
if (*p != ' ') { |
|
warning("space missing before w wfile"); |
|
return (p); |
|
} |
|
#endif |
|
EATSPACE(); |
EATSPACE(); |
q = wfile; |
if (*p == '\0') |
eq = wfile + sizeof(wfile) - 1; |
error(COMPILE, "filename expected"); |
while (*p) { |
s->wfile = duptoeol(p, "s command w flag", NULL); |
if (*p == '\n') |
*p = '\0'; |
break; |
|
if (q >= eq) |
|
error(COMPILE, "wfile too long"); |
|
*q++ = *p++; |
|
} |
|
*q = '\0'; |
|
if (q == wfile) |
|
error(COMPILE, "no wfile specified"); |
|
s->wfile = strdup(wfile); |
|
if (aflag) |
if (aflag) |
pledge_wpath = 1; |
pledge_wpath = 1; |
else if ((s->wfd = open(wfile, |
else if ((s->wfd = open(s->wfile, |
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, |
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, |
DEFFILEMODE)) == -1) |
DEFFILEMODE)) == -1) |
error(FATAL, "%s: %s", wfile, strerror(errno)); |
error(FATAL, "%s: %s", s->wfile, strerror(errno)); |
return (p); |
return (p); |
default: |
default: |
error(COMPILE, |
error(COMPILE, |