char buf[BUFSIZ], prompt[BUFSIZ];
char **argp, **arguments;
struct stat st;
- char *attach = (char *)0; /* attachment header field name */
+ char *attach = NULL; /* attachment header field name */
char cwd[MAXPATHLEN + 1]; /* current working directory */
char file[MAXPATHLEN + 1]; /* file name buffer */
char shell[MAXPATHLEN + 1]; /* shell response buffer */
** Get the initial current working directory.
*/
- if (getcwd(cwd, sizeof (cwd)) == (char *)0) {
+ if (getcwd(cwd, sizeof (cwd)) == NULL) {
adios("getcwd", "could not get working directory");
}
continue;
case ATTACHSW:
- if (attach != (char *)0)
+ if (attach != NULL)
adios(NULL, "only one attachment header field name at a time!");
if (!(attach = *argp++) || *attach == '-')
adios(NULL, "missing argument to %s",
** the absolute path.
*/
- if (*(argp+1) == (char *)0) {
- (void)sprintf(buf, "$SHELL -c \"cd;pwd\"");
+ if (*(argp+1) == NULL) {
+ sprintf(buf, "$SHELL -c \"cd;pwd\"");
} else {
writesomecmd(buf, BUFSIZ, "cd", "pwd", argp);
}
if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) {
fgets(cwd, sizeof (cwd), f);
- if (strchr(cwd, '\n') != (char *)0)
+ if (strchr(cwd, '\n') != NULL)
*strchr(cwd, '\n') = '\0';
pclose(f);
** accustomed to.
*/
writelscmd(buf, sizeof(buf), argp);
- (void)system_in_dir(cwd, buf);
+ system_in_dir(cwd, buf);
break;
case ALISTCMDSW:
** -n numbers listing
*/
- if (attach == (char *)0) {
- advise((char *)0, "can't list because no header field name was given.");
+ if (attach == NULL) {
+ advise(NULL, "can't list because no header field name was given.");
break;
}
- l = (char *)0;
+ l = NULL;
n = 0;
- while (*++argp != (char *)0) {
+ while (*++argp != NULL) {
if (strcmp(*argp, "-l") == 0)
l = "/";
}
if (n == -1)
- advise((char *)0, "usage is alist [-ln].");
+ advise(NULL, "usage is alist [-ln].");
else
annolist(drft, attach, l, n);
** Attach files to current draft.
*/
- if (attach == (char *)0) {
- advise((char *)0, "can't attach because no header field name was given.");
+ if (attach == NULL) {
+ advise(NULL, "can't attach because no header field name was given.");
break;
}
- if (*(argp+1) == (char *)0) {
- advise((char *)0, "attach command requires file argument(s).");
+ if (*(argp+1) == NULL) {
+ advise(NULL, "attach command requires file argument(s).");
break;
}
if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) {
while (fgets(shell, sizeof (shell), f)
- != (char *)0) {
+ != NULL) {
*(strchr(shell, '\n')) = '\0';
if (*shell == '/')
** Detach files from current draft.
*/
- if (attach == (char *)0) {
- advise((char *)0, "can't detach because no header field name was given.");
+ if (attach == NULL) {
+ advise(NULL, "can't detach because no header field name was given.");
break;
}
*/
for (n = 0, arguments = argp + 1;
- *arguments != (char *)0;
+ *arguments != NULL;
arguments++) {
if (strcmp(*arguments, "-n") == 0) {
n = 1;
if (n == 1) {
for (arguments = argp + 1;
- *arguments != (char *)0;
+ *arguments != NULL;
arguments++) {
if (strcmp(*arguments, "-n") == 0)
continue;
annotate(drft, attach, NULL,
1, 0, n, 1);
- for (argp = arguments + 1; *argp != (char *)0; argp++) {
+ for (argp = arguments + 1; *argp != NULL; argp++) {
if (atoi(*argp) > n) {
if (atoi(*argp) == 1)
*argp = "";
else
- (void)sprintf(*argp, "%d", atoi(*argp) - 1);
+ sprintf(*argp, "%d", atoi(*argp) - 1);
}
}
}
*/
int trailln = strlen(trailcmd) + 3;
if (ln < 0 || ln + trailln > bufsz)
- adios((char *)0, "arguments too long");
+ adios(NULL, "arguments too long");
cp = buf + ln;
- while (*++argp != (char *)0) {
+ while (*++argp != NULL) {
ln = strlen(*argp);
/* +1 for leading space */
if (ln + trailln + 1 > bufsz - (cp-buf))
- adios((char *)0, "arguments too long");
+ adios(NULL, "arguments too long");
*cp++ = ' ';
memcpy(cp, *argp, ln+1);
cp += ln;
char *cp, buf[BUFSIZ], **argp;
char **arguments, *vec[MAXARGS];
struct stat st;
- char *attach = (char *)0; /* attachment header field name */
+ char *attach = NULL; /* attachment header field name */
int attachformat = 0; /* mhbuild format specifier for attachments */
#ifndef lint