if (!child && toys.optc) {
int fd = pollfds[0].fd;
- if (!temp) close(sockfd);
dup2(fd, 0);
dup2(fd, 1);
if (toys.optflags&FLAG_L) dup2(fd, 2);
line = NULL;
linelen = nxtlinelen = 0;
len = getline(&line, (size_t*)&linelen, fl);
- if (len <= 0) return len;
+ if (len <= 0) {
+ free(line);
+ return len;
+ }
// checking for commented lines.
if (line[0] != '#') break;
free(line);
}
for (;;) {
if (line[len - 1] == '\n') len--;
- // checking line continuation.
- if (!len || line[len - 1] != '\\') break;
+ if (!len) {
+ free(line);
+ return len;
+ } else if (line[len - 1] != '\\') break;
+
len--;
nxtlen = getline(&nxtline, (size_t*)&nxtlinelen, fl);
if (nxtlen <= 0) break;
S_IRUSR|S_IWUSR ))
{
char *temp = getenv("HOME");
+
temp = xmprintf("%s/%s", temp ? temp : "", "nohup.out");
xcreate(temp, O_CREAT|O_APPEND|O_WRONLY, 0600);
+ free(temp);
}
}
if (isatty(0)) {