version 1.9, 1997/07/24 16:23:37 |
version 1.10, 1997/07/24 17:27:11 |
|
|
(void)snprintf(pathbuf, sizeof(pathbuf), "%s/mail.XXXXXXXXXX", tmpdir); |
(void)snprintf(pathbuf, sizeof(pathbuf), "%s/mail.XXXXXXXXXX", tmpdir); |
if ((c = mkstemp(pathbuf)) == -1 || (mestmp = Fdopen(c, "r+")) == NULL) |
if ((c = mkstemp(pathbuf)) == -1 || (mestmp = Fdopen(c, "r+")) == NULL) |
err(1, "can't open %s", pathbuf); |
err(1, "can't open %s", pathbuf); |
(void)unlink(pathbuf); |
(void)rm(pathbuf); |
|
|
if (offset == 0) { |
if (offset == 0) { |
msgCount = 0; |
msgCount = 0; |
|
|
/* fall through */ |
/* fall through */ |
} |
} |
if (name[0] == '+' && getfold(cmdbuf, sizeof(cmdbuf)) >= 0) { |
if (name[0] == '+' && getfold(cmdbuf, sizeof(cmdbuf)) >= 0) { |
snprintf(xname, sizeof(xname), "%s/%s", cmdbuf, name + 1); |
(void)snprintf(xname, sizeof(xname), "%s/%s", cmdbuf, name + 1); |
name = savestr(xname); |
name = savestr(xname); |
} |
} |
/* catch the most common shell meta character */ |
/* catch the most common shell meta character */ |
if (name[0] == '~' && (name[1] == '/' || name[1] == '\0')) { |
if (name[0] == '~' && (name[1] == '/' || name[1] == '\0')) { |
snprintf(xname, sizeof(xname), "%s%s", homedir, name + 1); |
(void)snprintf(xname, sizeof(xname), "%s%s", homedir, name + 1); |
name = savestr(xname); |
name = savestr(xname); |
} |
} |
if (!anyof(name, "~{[*?$`'\"\\")) |
if (!anyof(name, "~{[*?$`'\"\\")) |
|
|
warn("pipe"); |
warn("pipe"); |
return(name); |
return(name); |
} |
} |
snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name); |
(void)snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name); |
if ((shell = value("SHELL")) == NULL) |
if ((shell = value("SHELL")) == NULL) |
shell = _PATH_CSHELL; |
shell = _PATH_CSHELL; |
pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL); |
pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL); |
|
|
strncpy(name, folder, namelen-1); |
strncpy(name, folder, namelen-1); |
name[namelen-1] = '\0'; |
name[namelen-1] = '\0'; |
} else |
} else |
snprintf(name, namelen, "%s/%s", homedir, folder); |
(void)snprintf(name, namelen, "%s/%s", homedir, folder); |
return(0); |
return(0); |
} |
} |
|
|