Subject: long vs. int problems in recently posted Mail +fix (#119) Index: ucb/Mail 2.11BSD Description: There were a number of long vs int bugs which were overlooked in the recently posted NET2 version of 'Mail'. Repeat-By: Attempt to use the '~v' or '~e' commands to enter the editor while composing a mail item. The text of the mail item will not be present. Fix: Apply the following patch. All of the changes simply add a 'L' to the signal mask parameter in function calls. =============================cut here============================= *** /usr/src/ucb/Mail/cmd1.c.old Thu Oct 22 13:38:46 1992 --- /usr/src/ucb/Mail/cmd1.c Sun Feb 14 10:48:34 1993 *************** *** 435,440 **** } if ((cmd = value("LISTER")) == NOSTR) cmd = "ls"; ! (void) run_command(cmd, 0, -1, -1, dirname, NOSTR); return 0; } --- 435,440 ---- } if ((cmd = value("LISTER")) == NOSTR) cmd = "ls"; ! (void) run_command(cmd, 0L, -1, -1, dirname, NOSTR); return 0; } *** /usr/src/ucb/Mail/cmd3.c.old Thu Oct 22 13:46:55 1992 --- /usr/src/ucb/Mail/cmd3.c Sun Feb 14 10:49:30 1993 *************** *** 59,65 **** return 1; if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! (void) run_command(shell, 0, -1, -1, "-c", cmd, NOSTR); (void) signal(SIGINT, sigint); printf("!\n"); return 0; --- 59,65 ---- return 1; if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! (void) run_command(shell, 0L, -1, -1, "-c", cmd, NOSTR); (void) signal(SIGINT, sigint); printf("!\n"); return 0; *************** *** 77,83 **** if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! (void) run_command(shell, 0, -1, -1, NOSTR); (void) signal(SIGINT, sigint); putchar('\n'); return 0; --- 77,83 ---- if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! (void) run_command(shell, 0L, -1, -1, NOSTR); (void) signal(SIGINT, sigint); putchar('\n'); return 0; *** /usr/src/ucb/Mail/collect.c.old Fri Nov 13 23:27:41 1992 --- /usr/src/ucb/Mail/collect.c Sun Feb 14 10:49:51 1993 *************** *** 470,476 **** * stdin = current message. * stdout = new message. */ ! if (run_command(cmd, 0, fileno(fp), fileno(nf), NOSTR) < 0) { (void) Fclose(nf); goto out; } --- 470,476 ---- * stdin = current message. * stdout = new message. */ ! if (run_command(cmd, 0L, fileno(fp), fileno(nf), NOSTR) < 0) { (void) Fclose(nf); goto out; } *** /usr/src/ucb/Mail/edit.c.old Thu Oct 22 13:47:59 1992 --- /usr/src/ucb/Mail/edit.c Sun Feb 14 10:47:20 1993 *************** *** 184,190 **** nf = NULL; if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NOSTR) edit = type == 'e' ? _PATH_EX : _PATH_VI; ! if (run_command(edit, 0, -1, -1, tempEdit, NOSTR) < 0) { (void) unlink(tempEdit); goto out; } --- 184,190 ---- nf = NULL; if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NOSTR) edit = type == 'e' ? _PATH_EX : _PATH_VI; ! if (run_command(edit, 0L, -1, -1, tempEdit, NOSTR) < 0) { (void) unlink(tempEdit); goto out; } *** /usr/src/ucb/Mail/fio.c.old Tue Oct 27 10:53:25 1992 --- /usr/src/ucb/Mail/fio.c Sun Feb 14 11:24:19 1993 *************** *** 349,355 **** sprintf(cmdbuf, "echo %s", name); if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NOSTR); if (pid < 0) { close(pivec[0]); close(pivec[1]); --- 349,355 ---- sprintf(cmdbuf, "echo %s", name); if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! pid = start_command(shell, 0L, -1, pivec[1], "-c", cmdbuf, NOSTR); if (pid < 0) { close(pivec[0]); close(pivec[1]); *** /usr/src/ucb/Mail/popen.c.old Tue Oct 27 10:49:07 1992 --- /usr/src/ucb/Mail/popen.c Sun Feb 14 11:26:35 1993 *************** *** 101,107 **** hisside = fd0 = p[READ]; fd1 = -1; } ! if ((pid[myside] = start_command(cmd, 0, fd0, fd1, NOSTR)) < 0) { close(p[READ]); close(p[WRITE]); return NULL; --- 101,107 ---- hisside = fd0 = p[READ]; fd1 = -1; } ! if ((pid[myside] = start_command(cmd, 0L, fd0, fd1, NOSTR)) < 0) { close(p[READ]); close(p[WRITE]); return NULL;