home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / mush6.0 / patch1 / Diffs next >
Encoding:
Text File  |  1988-04-28  |  12.5 KB  |  459 lines

  1.  
  2. *** OLD/commands.c    Wed Apr  6 22:47:58 1988
  3. --- commands.c    Tue Apr 26 20:08:49 1988
  4. ***************
  5. *** 747,757 ****
  6.       return -1;
  7.   }
  8.   
  9. ! Printenv()
  10.   {
  11. !     char **e = environ;
  12. !     while (*e)
  13. !     wprint("%s\n", *e++);
  14.       return -1;
  15.   }
  16.   
  17. --- 747,759 ----
  18.       return -1;
  19.   }
  20.   
  21. ! Printenv(argc, argv)
  22. ! char **argv;
  23.   {
  24. !     char **e;
  25. !     for (e = environ; *e; e++)
  26. !     if (argc < 1 || !strncmp(*e, argv[1]))
  27. !         wprint("%s\n", *e);
  28.       return -1;
  29.   }
  30.   
  31. *** OLD/curses.c    Wed Apr  6 22:47:58 1988
  32. --- curses.c    Wed Apr 27 21:48:35 1988
  33. ***************
  34. *** 120,127 ****
  35.       if (isoff(glob_flags, CNTD_CMD)) {
  36.       (void) check_new_mail();
  37.       curlin = max(1, current_msg - n_array[0] + 1);
  38. !     (void) strncpy(buf, stdscr->_y[curlin], COLS-1);
  39. !     buf[COLS-1] = 0; /* strncpy does not null terminate */
  40.       if (ison(glob_flags, REV_VIDEO) && msg_cnt)
  41.           STANDOUT(curlin, 0, buf);
  42.       mail_status(0);
  43. --- 120,126 ----
  44.       if (isoff(glob_flags, CNTD_CMD)) {
  45.       (void) check_new_mail();
  46.       curlin = max(1, current_msg - n_array[0] + 1);
  47. !     scrn_line(curlin, buf);
  48.       if (ison(glob_flags, REV_VIDEO) && msg_cnt)
  49.           STANDOUT(curlin, 0, buf);
  50.       mail_status(0);
  51. ***************
  52. *** 707,711 ****
  53. --- 706,726 ----
  54.       }
  55.       turnoff(glob_flags, DO_UPDATE);
  56.       return 1; /* make sure bottom line is clear and no reverse video */
  57. + }
  58. + scrn_line(line, buf)
  59. + char *buf;
  60. + {
  61. + #ifndef A_CHARTEXT
  62. +     (void) strncpy(buf, stdscr->_y[line], COLS-1);
  63. +     buf[COLS-1] = 0; /* strncpy does not null terminate */
  64. + #else
  65. +     int n;
  66. +     for (n = 0; n < COLS; n++)
  67. +     if ((buf = mvinch(curline, n) & A_CHARTEXT) == '\0')
  68. +         break;
  69. +     buf[n] = '\0';
  70. + #endif /* A_CHARTEXT */
  71.   }
  72.   #endif /* CURSES */
  73. *** OLD/hdrs.c    Wed Apr  6 22:48:00 1988
  74. --- hdrs.c    Tue Apr 26 19:32:11 1988
  75. ***************
  76. *** 253,259 ****
  77.       register char *p, *b;
  78.       char from[256], subject[256], date[17], lines[16], chars[16], line[256];
  79.       char to[256], addr[256], name[256], status[2];
  80. !     char Day[3], Mon[4], Tm[8], Yr[5], Wkday[4];
  81.   
  82.       /* status of the message */
  83.       if (ison(msg[cnt].m_flags, DELETE))
  84. --- 253,259 ----
  85.       register char *p, *b;
  86.       char from[256], subject[256], date[17], lines[16], chars[16], line[256];
  87.       char to[256], addr[256], name[256], status[2];
  88. !     char Day[3], Mon[4], Tm[8], Yr[5], Wkday[4], *date_p;
  89.   
  90.       /* status of the message */
  91.       if (ison(msg[cnt].m_flags, DELETE))
  92. ***************
  93. *** 319,326 ****
  94.       (void) get_name_n_addr(from, name, addr);
  95.       }
  96.   
  97. !     if (p = msg_date(cnt))
  98. !     date_to_string(p, Yr, Mon, Day, Wkday, Tm, date);
  99.   
  100.       (void) sprintf(lines, "%d", msg[cnt].m_lines);
  101.       (void) sprintf(chars, "%ld", msg[cnt].m_size);
  102. --- 319,327 ----
  103.       (void) get_name_n_addr(from, name, addr);
  104.       }
  105.   
  106. !     if (date_p = msg_date(cnt))
  107. !     /* don't take weekday unless specified explicitly.  See 'D' below */
  108. !     date_to_string(date_p, Yr, Mon, Day, NULL, Tm, date);
  109.   
  110.       (void) sprintf(lines, "%d", msg[cnt].m_lines);
  111.       (void) sprintf(chars, "%ld", msg[cnt].m_size);
  112. ***************
  113. *** 394,400 ****
  114.           when 'M': p2 = Mon;
  115.           when 'Y': p2 = Yr;
  116.           when 'N': p2 = Day;
  117. !         when 'D': p2 = Wkday;
  118.           otherwise: continue; /* unknown formatting char */
  119.           }
  120.           len = strlen(sprintf(b, fmt, p2));
  121. --- 395,409 ----
  122.           when 'M': p2 = Mon;
  123.           when 'Y': p2 = Yr;
  124.           when 'N': p2 = Day;
  125. !         when 'D': {
  126. !             /* specifying weekday name (sun, mon, tue, etc..) can be
  127. !              * very slow due to lots of *,/, and % operators.
  128. !              */
  129. !             char unused[16]; /* for date_to_string */
  130. !             if (*(p2 = Wkday) == '\0')
  131. !             (void) date_to_string(date_p, NULL, NULL, NULL,
  132. !                           p2, NULL, unused);
  133. !         }
  134.           otherwise: continue; /* unknown formatting char */
  135.           }
  136.           len = strlen(sprintf(b, fmt, p2));
  137. *** OLD/loop.c    Wed Apr  6 22:48:00 1988
  138. --- loop.c    Tue Apr 26 18:49:13 1988
  139. ***************
  140. *** 51,57 ****
  141.       (void) signal(SIGQUIT, catch);
  142.       (void) signal(SIGHUP, catch);
  143.       (void) signal(SIGTERM, catch);
  144. !     (void) signal(SIGCHLD, sigchldcatcher);
  145.       (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
  146.   
  147.       turnoff(glob_flags, IGN_SIGS);
  148. --- 51,63 ----
  149.       (void) signal(SIGQUIT, catch);
  150.       (void) signal(SIGHUP, catch);
  151.       (void) signal(SIGTERM, catch);
  152. !     (void) signal(SIGCHLD,
  153. ! #ifndef SYSV
  154. !                sigchldcatcher
  155. ! #else /* SYSV */
  156. !                SIG_DFL
  157. ! #endif /* SYSV */
  158. !                );
  159.       (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
  160.   
  161.       turnoff(glob_flags, IGN_SIGS);
  162. ***************
  163. *** 97,103 ****
  164.        * (current message, deleted, unread, etc) are found in mail_status.
  165.        */
  166.       mail_status(1);
  167. !     if (Getstr(line, 256, 0) > -1)
  168.           p = line;
  169.       else {
  170.           if (p = do_set(set_options, "ignoreeof")) {
  171. --- 103,109 ----
  172.        * (current message, deleted, unread, etc) are found in mail_status.
  173.        */
  174.       mail_status(1);
  175. !     if (Getstr(line, sizeof(line), 0) > -1)
  176.           p = line;
  177.       else {
  178.           if (p = do_set(set_options, "ignoreeof")) {
  179. *** OLD/mail.c    Wed Apr  6 22:48:01 1988
  180. --- mail.c    Tue Apr 26 20:09:58 1988
  181. ***************
  182. *** 1137,1150 ****
  183.   
  184.       /* Make folders conform to RFC-822 by adding From: and Date: headers.
  185.        * Some older mailers (binmail, execmail, delivermail), don't add
  186. !      * these headers to the MTA, so add them for OLD_MAIL systems.
  187.        */
  188.       for (size = 0; size < next_file; size++) {
  189.       time_t t;
  190. ! #ifndef OLD_MAIL
  191.       if (size == 0)
  192.           continue;
  193. ! #endif /* OLD_MAIL */
  194.       (void) time(&t);
  195.       if (size > 0) {
  196.   #ifndef MSG_SEPARATOR
  197. --- 1137,1150 ----
  198.   
  199.       /* Make folders conform to RFC-822 by adding From: and Date: headers.
  200.        * Some older mailers (binmail, execmail, delivermail), don't add
  201. !      * these headers to the MTA, so add them for OLD_MAILER systems.
  202.        */
  203.       for (size = 0; size < next_file; size++) {
  204.       time_t t;
  205. ! #ifndef OLD_MAILER
  206.       if (size == 0)
  207.           continue;
  208. ! #endif /* OLD_MAILER */
  209.       (void) time(&t);
  210.       if (size > 0) {
  211.   #ifndef MSG_SEPARATOR
  212. *** OLD/msgs.c  Wed Apr  6 22:48:02 1988
  213. --- msgs.c      Tue Apr 26 20:14:45 1988
  214. ***************
  215. *** 305,310 ****
  216. --- 307,313 ----
  217.           (void) fclose(mail_fp);
  218.           return;
  219.       }
  220. +     (void) fseek(tmpf, 0L, 2); /* assure we're at the end of the file */
  221.       } else if (msg_cnt)
  222.       (void) fseek(tmpf, msg[msg_cnt-1].m_offset+msg[msg_cnt-1].m_size,L_SET);
  223.   
  224. *** OLD/mush.h    Wed Apr  6 22:48:02 1988
  225. --- mush.h    Tue Apr 26 21:09:52 1988
  226. ***************
  227. *** 1,6 ****
  228.   /* @(#)mush.h    (c) copyright 1986 (Dan Heller) */
  229.   
  230. ! #define VERSION "Mail User's Shell (Vers 6.0) Sat Apr  2 19:36:07 PST 1988"
  231.   
  232.   #include "config.h"
  233.   
  234. --- 1,6 ----
  235.   /* @(#)mush.h    (c) copyright 1986 (Dan Heller) */
  236.   
  237. ! #define VERSION "Mail User's Shell (6.1 4/26/88)"
  238.   
  239.   #include "config.h"
  240.   
  241. ***************
  242. *** 78,85 ****
  243.   #ifdef putchar
  244.   #undef putchar
  245.   #endif /* putchar */
  246. ! #define putchar(c)    fputc(c, stdout)
  247. ! #define bell()         fputc('\007', stderr)
  248.   
  249.   /* For error recovery purposes, send keyboard generated signals to a special
  250.    * routine (interrupt) to set a global flag (WAS_INTR) and return to the
  251. --- 78,85 ----
  252.   #ifdef putchar
  253.   #undef putchar
  254.   #endif /* putchar */
  255. ! #define putchar(c)    fputc(c, stdout), fflush(stdout)
  256. ! #define bell()         fputc('\007', stderr), fflush(stderr)
  257.   
  258.   /* For error recovery purposes, send keyboard generated signals to a special
  259.    * routine (interrupt) to set a global flag (WAS_INTR) and return to the
  260. ***************
  261. *** 181,190 ****
  262.   #endif /* F_OK */
  263.   typedef    unsigned long    u_long;
  264.   #define vfork   fork
  265. ! #ifdef SIGCHLD
  266. ! #undef SIGCHLD
  267. ! #endif /* SIGCHLD */
  268.   #define SIGCHLD SIGCLD
  269.   #endif /* SYSV */
  270.   
  271.   #if !defined(SUNTOOL) && !defined(CURSES)
  272. --- 181,189 ----
  273.   #endif /* F_OK */
  274.   typedef    unsigned long    u_long;
  275.   #define vfork   fork
  276. ! #ifndef SIGCHLD
  277.   #define SIGCHLD SIGCLD
  278. + #endif /* SIGCHLD */
  279.   #endif /* SYSV */
  280.   
  281.   #if !defined(SUNTOOL) && !defined(CURSES)
  282. ***************
  283. *** 277,283 ****
  284.   #define NO_FLG        0
  285.   
  286.   /* various flags */
  287. ! long   glob_flags;    /* global boolean flags thruout the whole program */
  288.   #define DO_UPDATE   1    /* check for changes to avoid unnecessary copyback */
  289.   #define REV_VIDEO   2    /* reverse video for curses or toolmode */
  290.   #define CONT_PRNT   3    /* continue to print (maybe a printf) without a '\n' */
  291. --- 276,282 ----
  292.   #define NO_FLG        0
  293.   
  294.   /* various flags */
  295. ! u_long   glob_flags;    /* global boolean flags thruout the whole program */
  296.   #define DO_UPDATE   1    /* check for changes to avoid unnecessary copyback */
  297.   #define REV_VIDEO   2    /* reverse video for curses or toolmode */
  298.   #define CONT_PRNT   3    /* continue to print (maybe a printf) without a '\n' */
  299. *** OLD/signals.c    Wed Apr  6 22:48:03 1988
  300. --- signals.c    Wed Apr 27 21:36:43 1988
  301. ***************
  302. *** 179,186 ****
  303.               msg_cnt) {
  304.           int curlin = max(1, current_msg - n_array[0] + 1);
  305.           char buf[256];
  306. !         (void) strncpy(buf, stdscr->_y[curlin], COLS-1);
  307. !         buf[COLS-1] = 0; /* strncpy does not null terminate */
  308.           STANDOUT(curlin, 0, buf);
  309.           }
  310.           print("Stopping...");
  311. --- 179,185 ----
  312.               msg_cnt) {
  313.           int curlin = max(1, current_msg - n_array[0] + 1);
  314.           char buf[256];
  315. !         scrn_line(curlin, buf);
  316.           STANDOUT(curlin, 0, buf);
  317.           }
  318.           print("Stopping...");
  319.  
  320. *** OLD/print.c    Thu Apr 28 22:45:28 1988
  321. --- print.c    Thu Apr 28 22:45:59 1988
  322. ***************
  323. *** 1,3 ****
  324. --- 1,4 ----
  325.   /* @(#)print.c    2.4    (c) copyright 10/15/86 (Dan Heller) */
  326.   
  327.   #include "mush.h"
  328. ***************
  329. *** 36,43 ****
  330.       static int x; /* position on line saved for continued prints */
  331.       char *p; /* same type as struct file _ptr,_buf in stdio.h */
  332.   
  333. -     va_start(args); /* have args point to the beginning of argument stack */
  334.   #ifdef CURSES
  335.       if (iscurses) {
  336.       if (isoff(glob_flags, CONT_PRNT))
  337. --- 37,42 ----
  338. ***************
  339. *** 45,72 ****
  340.       } else
  341.   #endif /* CURSES */
  342.       if (istool < 2) {
  343.   #ifdef VPRINTF
  344.           vprintf(fmt, args);
  345.   #else /* VPRINTF */
  346.           _doprnt(fmt, args, stdout);
  347.   #endif /* VPRINTF */
  348. -         fflush(stdout);
  349.           va_end(args);
  350.           return;
  351.       }
  352.   #ifdef VPRINTF
  353. !     if (fmt)
  354. !     vsprintf(msgbuf, fmt, args); /* NULL in fmt reprints last msg */
  355.   #else /* VPRINTF */
  356. !     foo._cnt = BUFSIZ;
  357. !     foo._base = foo._ptr = msgbuf; /* may have to be cast(unsigned char *) */
  358. !     foo._flag = _IOWRT+_IOSTRG;
  359. !     if (fmt) {   /* passing NULL (not "") reprints last message */
  360. !     (void) _doprnt(fmt, args, &foo);
  361. !     *foo._ptr = '\0'; /* plant terminating null character */
  362.       }
  363. - #endif /* VPIRNTF */
  364. -     va_end(args);
  365.       p = msgbuf;
  366.       if (iscurses || istool)
  367.       while (p = index(p, '\n'))
  368. --- 44,72 ----
  369.       } else
  370.   #endif /* CURSES */
  371.       if (istool < 2) {
  372. +         va_start(args);
  373.   #ifdef VPRINTF
  374.           vprintf(fmt, args);
  375.   #else /* VPRINTF */
  376.           _doprnt(fmt, args, stdout);
  377.   #endif /* VPRINTF */
  378.           va_end(args);
  379. +         fflush(stdout);
  380.           return;
  381.       }
  382. +     if (fmt) {
  383. +         va_start(args);
  384.   #ifdef VPRINTF
  385. !         vsprintf(msgbuf, fmt, args); /* NULL in fmt reprints last msg */
  386.   #else /* VPRINTF */
  387. !         foo._cnt = BUFSIZ;
  388. !         foo._base = foo._ptr = msgbuf; /* may have to be cast(unsigned char *) */
  389. !         foo._flag = _IOWRT+_IOSTRG;
  390. !         (void) _doprnt(fmt, args, &foo);
  391. !         *foo._ptr = '\0'; /* plant terminating null character */
  392. ! #endif /* VPRINTF */
  393. !         va_end(args);
  394.       }
  395.       p = msgbuf;
  396.       if (iscurses || istool)
  397.       while (p = index(p, '\n'))
  398. ***************
  399. *** 88,93 ****
  400. --- 88,94 ----
  401.           turnon(glob_flags, CNTD_CMD); /* display ...continue... prompt */
  402.       }
  403.       turnoff(glob_flags, CONT_PRNT);
  404. +     fflush(stdout); /* some sys-v's aren't fflushing \n's */
  405.       return;
  406.       }
  407.   #endif /* CURSES */
  408. ***************
  409. *** 117,125 ****
  410.       char msgbuf[BUFSIZ]; /* we're not getting huge strings */
  411.       va_list args;
  412.   
  413. -     va_start(args);
  414.       if (istool < 2) {
  415.   #ifdef VPRINTF
  416.       vprintf(fmt, args);
  417.   #else /* VPRINTF */
  418. --- 118,125 ----
  419.       char msgbuf[BUFSIZ]; /* we're not getting huge strings */
  420.       va_list args;
  421.   
  422.       if (istool < 2) {
  423. +     va_start(args);
  424.   #ifdef VPRINTF
  425.       vprintf(fmt, args);
  426.   #else /* VPRINTF */
  427. ***************
  428. *** 131,136 ****
  429. --- 131,137 ----
  430.       }
  431.       if (!fmt)
  432.       return;
  433. +     va_start(args);
  434.   #ifdef VPRINTF
  435.       vsprintf(msgbuf, fmt, args); /* NULL in fmt reprints last msg */
  436.   #else /* VPRINTF */
  437. ***************
  438. *** 140,145 ****
  439. --- 141,147 ----
  440.       _doprnt(fmt, args, &foo); /* format like printf into msgbuf via foo */
  441.       *foo._ptr = '\0'; /* plant terminating null character */
  442.   #endif /* VPRINTF */
  443. +     va_end(args);
  444.       Addstr(msgbuf);  /* addstr() will scroll if necessary */
  445.   }
  446.   
  447. ***************
  448. *** 183,185 ****
  449. --- 185,188 ----
  450.   {
  451.       print("");
  452.   }
  453.