home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / arnold / Source / mush.rstevens.tar.gz / mush.tar / Patch.solaris.bsdi < prev    next >
Text File  |  1994-07-09  |  22KB  |  810 lines

  1. *** execute.c    Tue Mar 31 16:03:47 1992
  2. --- ../mush-7.2.5/execute.c    Sun Jun 12 16:44:12 1994
  3. ***************
  4. *** 1,7 ****
  5.   /* execute.c     (c) copyright    10/28/86 (Dan Heller) */
  6.   
  7.   #include "mush.h"
  8. ! #if defined(BSD) || defined(IRIX4)
  9.   #include <sys/wait.h>
  10.   #else
  11.   #ifndef SYSV
  12. --- 1,7 ----
  13.   /* execute.c     (c) copyright    10/28/86 (Dan Heller) */
  14.   
  15.   #include "mush.h"
  16. ! #if defined(BSD) || defined(IRIX4) || defined(POSIX)
  17.   #include <sys/wait.h>
  18.   #else
  19.   #ifndef SYSV
  20. ***************
  21. *** 88,98 ****
  22.   execute(argv)
  23.   char **argv;
  24.   {
  25. ! #ifdef SYSV
  26.       int status;
  27.   #else
  28.       union wait status;
  29. ! #endif /* SYSV */
  30.   #ifdef SIGCONT
  31.       SIGRET (*oldstop)(), (*oldcont)();
  32.   #endif /* SIGCONT */
  33. --- 88,98 ----
  34.   execute(argv)
  35.   char **argv;
  36.   {
  37. ! #if defined(SYSV) || defined(POSIX) || defined (BSD44)
  38.       int status;
  39.   #else
  40.       union wait status;
  41. ! #endif /* SYSV || POSIX || BSD44 */
  42.   #ifdef SIGCONT
  43.       SIGRET (*oldstop)(), (*oldcont)();
  44.   #endif /* SIGCONT */
  45. ***************
  46. *** 142,154 ****
  47.   SIGRET
  48.   sigchldcatcher()
  49.   {
  50. ! #ifdef SYSV
  51.       int status;
  52.   #else
  53.       union wait status;
  54. ! #endif /* SYSV */
  55.       int       pid;
  56.   
  57.   #if defined(BSD) || defined(IRIX4)
  58.       while ((pid = wait3(&status, WNOHANG, (struct rusage *)0)) > 0) {
  59.       Debug("%d died...\n", pid);
  60. --- 142,161 ----
  61.   SIGRET
  62.   sigchldcatcher()
  63.   {
  64. ! #if defined(SYSV) || defined(POSIX) || defined(BSD44)
  65.       int status;
  66.   #else
  67.       union wait status;
  68. ! #endif /* SYSV || POSIX || BSD44 */
  69.       int       pid;
  70.   
  71. + #ifdef POSIX /* this could probably be done smarter */
  72. +     while ((pid = waitpid(-1,&status, WNOHANG)) > 0) {
  73. +     Debug("%d died...\n", pid);
  74. +     if (pid == exec_pid)
  75. +         break;
  76. +     }
  77. + #else
  78.   #if defined(BSD) || defined(IRIX4)
  79.       while ((pid = wait3(&status, WNOHANG, (struct rusage *)0)) > 0) {
  80.       Debug("%d died...\n", pid);
  81. ***************
  82. *** 164,169 ****
  83. --- 171,177 ----
  84.       Debug("%d died...\n", pid);
  85.   #endif /* SYSV */
  86.   #endif /* BSD || IRIX4 */
  87. + #endif /* POSIX */
  88.       if (pid == exec_pid && pid > 0) {
  89.       exec_pid = 0;
  90.       longjmp(execjbuf, 1);
  91. *** glob.c    Thu May  3 14:40:15 1990
  92. --- ../mush-7.2.5/glob.c    Mon Jun 13 10:15:41 1994
  93. ***************
  94. *** 340,345 ****
  95. --- 340,436 ----
  96.   }
  97.   
  98.   /*
  99. +  * Match a pattern set {s1,s2,...} followed by any other pattern.
  100. +  * Pattern sets and other patterns may nest arbitrarily.
  101. +  *
  102. +  * If "mat" is not a null pointer, a vector of possible expansions
  103. +  * is generated and placed in *mat; otherwise, the expansions are
  104. +  * matched against str and a truth value is returned ("/" is NOT
  105. +  * treated as a directory separator in this case).  NOTE: The vector
  106. +  * of expansions may still contain nested pattern sets, which must
  107. +  * be expanded separately.  See sxp().
  108. +  *
  109. +  * Currently allows at most 256 alternatives per set.  Enough? :-)
  110. +  */
  111. + static
  112. + sglob(str, pato, mat)
  113. + char *str, *pato, ***mat;
  114. + {
  115. +     char *p, *newpat[256], *oldpat[256], buf[MAXPATHLEN], *b = buf;
  116. +     int copy = 1, nest = 0, i = 0, ret = 0;
  117. +     char *pat,*pat2;
  118. +     if (!pato || !str)
  119. +     return FALSE;
  120. +     pat2 = savestr(pato);
  121. +     if (!pat2)
  122. +     return FALSE;
  123. +     pat = pat2;
  124. +     while (*pat) {
  125. +     if (copy)
  126. +         if (*pat != '{') /*}*/ {
  127. +         if (*pat == '\\' && pat[1])
  128. +             *b++ = *pat++;
  129. +         *b++ = *pat++;
  130. +         continue;
  131. +         } else {
  132. +         copy = 0;
  133. +         pat++;
  134. +         }
  135. +     p = pat;
  136. +     while (*pat && (nest || *pat != ',' && /*{*/ *pat != '}')) {
  137. +         if (*pat == '\\')
  138. +         pat++;
  139. +         else if (*pat == '{')
  140. +         nest++;
  141. +         else if (*pat == '}')
  142. +         nest--;
  143. +         if (*pat)
  144. +         pat++;
  145. +     }
  146. +     if (*pat) {
  147. +         oldpat[i] = pat;
  148. +         newpat[i++] = p;
  149. +         if (*pat != ',') {
  150. +         *pat++ = 0;
  151. +         break;
  152. +         } else
  153. +         *pat++ = 0;
  154. +     }
  155. +     }
  156. +     oldpat[i] = NULL;
  157. +     if (i > 0 && mat) {
  158. +     *mat = (char **)malloc((unsigned)((i + 1) * sizeof(char *)));
  159. +     if (*mat)
  160. +         (*mat)[i] = NULL;
  161. +     else{
  162. +         xfree(pat2);
  163. +         return -1;
  164. +       }
  165. +     ret = i;
  166. +     }
  167. +     while (!mat && i-- > 0)
  168. +     if (ret = glob2(str, newpat[i], pat))
  169. +         break;
  170. +     for (i = 0; oldpat[i]; i++) {
  171. +     if (mat && *mat) {
  172. +         (void) sprintf(b, "%s%s", newpat[i], pat);
  173. +         (*mat)[i] = savestr(buf);
  174. +     }
  175. +     if (oldpat[i + 1])
  176. +         oldpat[i][0] = ',';
  177. +     else
  178. +         oldpat[i][0] = /*{*/ '}';
  179. +     }
  180. +     if (ret == 0 && b > buf && mat) {
  181. +     *b = 0;
  182. +     ret = ((*mat = unitv(buf)) ? 1 : -1);
  183. +     }
  184. +     xfree(pat2);
  185. +     return ret;
  186. + }
  187. + /*
  188.    * The basic globbing matcher.
  189.    *
  190.    * "*"           = match 0 or more occurances of anything
  191. ***************
  192. *** 434,523 ****
  193.       while (*pat == '*')
  194.       pat++;
  195.       return ((*str == '\0') && (*pat == '\0'));
  196. - }
  197. - /*
  198. -  * Match a pattern set {s1,s2,...} followed by any other pattern.
  199. -  * Pattern sets and other patterns may nest arbitrarily.
  200. -  *
  201. -  * If "mat" is not a null pointer, a vector of possible expansions
  202. -  * is generated and placed in *mat; otherwise, the expansions are
  203. -  * matched against str and a truth value is returned ("/" is NOT
  204. -  * treated as a directory separator in this case).  NOTE: The vector
  205. -  * of expansions may still contain nested pattern sets, which must
  206. -  * be expanded separately.  See sxp().
  207. -  *
  208. -  * Currently allows at most 256 alternatives per set.  Enough? :-)
  209. -  */
  210. - static
  211. - sglob(str, pat, mat)
  212. - char *str, *pat, ***mat;
  213. - {
  214. -     char *p, *newpat[256], *oldpat[256], buf[MAXPATHLEN], *b = buf;
  215. -     int copy = 1, nest = 0, i = 0, ret = 0;
  216. -     if (!pat)
  217. -     return FALSE;
  218. -     while (*pat) {
  219. -     if (copy)
  220. -         if (*pat != '{') /*}*/ {
  221. -         if (*pat == '\\' && pat[1])
  222. -             *b++ = *pat++;
  223. -         *b++ = *pat++;
  224. -         continue;
  225. -         } else {
  226. -         copy = 0;
  227. -         pat++;
  228. -         }
  229. -     p = pat;
  230. -     while (*pat && (nest || *pat != ',' && /*{*/ *pat != '}')) {
  231. -         if (*pat == '\\')
  232. -         pat++;
  233. -         else if (*pat == '{')
  234. -         nest++;
  235. -         else if (*pat == '}')
  236. -         nest--;
  237. -         if (*pat)
  238. -         pat++;
  239. -     }
  240. -     if (*pat) {
  241. -         oldpat[i] = pat;
  242. -         newpat[i++] = p;
  243. -         if (*pat != ',') {
  244. -         *pat++ = 0;
  245. -         break;
  246. -         } else
  247. -         *pat++ = 0;
  248. -     }
  249. -     }
  250. -     oldpat[i] = NULL;
  251. -     if (i > 0 && mat) {
  252. -     *mat = (char **)malloc((unsigned)((i + 1) * sizeof(char *)));
  253. -     if (*mat)
  254. -         (*mat)[i] = NULL;
  255. -     else
  256. -         return -1;
  257. -     ret = i;
  258. -     }
  259. -     while (!mat && i-- > 0)
  260. -     if (ret = glob2(str, newpat[i], pat))
  261. -         break;
  262. -     for (i = 0; oldpat[i]; i++) {
  263. -     if (mat && *mat) {
  264. -         (void) sprintf(b, "%s%s", newpat[i], pat);
  265. -         (*mat)[i] = savestr(buf);
  266. -     }
  267. -     if (oldpat[i + 1])
  268. -         oldpat[i][0] = ',';
  269. -     else
  270. -         oldpat[i][0] = /*{*/ '}';
  271. -     }
  272. -     if (ret == 0 && b > buf && mat) {
  273. -     *b = 0;
  274. -     ret = ((*mat = unitv(buf)) ? 1 : -1);
  275. -     }
  276. -     return ret;
  277.   }
  278.   
  279.   /*
  280. --- 525,530 ----
  281. *** hdrs.c    Fri Oct 30 13:55:32 1992
  282. --- ../mush-7.2.5/hdrs.c    Sun Jun 12 15:37:34 1994
  283. ***************
  284. *** 672,679 ****
  285.       if (!unscramble_addr(p, line)) { /* p is safely recopied to line */
  286.           p2 = addr;
  287.           goto BrokenFrom;
  288. !     } else
  289.           p2 = NULL;
  290.   #else /* MSG_SEPARATOR */
  291.       wprint("Warning: unable to find who msg %d is from!\n", n+1);
  292.       p2 = addr;
  293. --- 672,681 ----
  294.       if (!unscramble_addr(p, line)) { /* p is safely recopied to line */
  295.           p2 = addr;
  296.           goto BrokenFrom;
  297. !     } else {
  298. !         p = line;
  299.           p2 = NULL;
  300. +     }
  301.   #else /* MSG_SEPARATOR */
  302.       wprint("Warning: unable to find who msg %d is from!\n", n+1);
  303.       p2 = addr;
  304. *** loop.c    Fri Oct 30 13:55:35 1992
  305. --- ../mush-7.2.5/loop.c    Tue Jun 21 09:13:58 1994
  306. ***************
  307. *** 936,958 ****
  308.   register char *str;
  309.   int *argc;
  310.   {
  311. !     register char    *s = NULL, *p;
  312.       register int    tmp, err = 0, unq_sep = 0;
  313.       char        *newargv[MAXARGS], **argv, *p2, c, buf[BUFSIZ];
  314.   
  315.       if (debug > 3)
  316. !     (void) printf("Working on: %s\n",str);
  317.       /* If final is true, do variable expansions first */
  318.       if (final) {
  319. !     (void) strcpy(buf, str);
  320. !     str = buf;
  321. !     if (!variable_expand(str))
  322.           return DUBL_NULL;
  323.       }
  324.       *argc = 0;
  325. !     while (*str && *argc < MAXARGS) {
  326. !     while (isspace(*str))
  327. !         ++str;
  328.       /* When we have hit an unquoted `;', final must be true,
  329.        * so we're finished.  Stuff the rest of the string at the
  330.        * end of the argv -- do_command will pass it back later,
  331. --- 936,961 ----
  332.   register char *str;
  333.   int *argc;
  334.   {
  335. !     register char    *s = NULL, *p,*str1;
  336.       register int    tmp, err = 0, unq_sep = 0;
  337.       char        *newargv[MAXARGS], **argv, *p2, c, buf[BUFSIZ];
  338.   
  339. +     if((str1=savestr(str)) == NULL)
  340. +       return DUBL_NULL;;
  341.       if (debug > 3)
  342. !     (void) printf("Working on: %s\n",str1);
  343.       /* If final is true, do variable expansions first */
  344.       if (final) {
  345. !     (void) strcpy(buf, str1);
  346. !     free(str1);
  347. !     str1 = buf;
  348. !     if (!variable_expand(str1))
  349.           return DUBL_NULL;
  350.       }
  351.       *argc = 0;
  352. !     while (*str1 && *argc < MAXARGS) {
  353. !     while (isspace(*str1))
  354. !         ++str1;
  355.       /* When we have hit an unquoted `;', final must be true,
  356.        * so we're finished.  Stuff the rest of the string at the
  357.        * end of the argv -- do_command will pass it back later,
  358. ***************
  359. *** 961,1014 ****
  360.        * loop, so unq_sep should always be initialized to 0.
  361.        */
  362.       if (unq_sep && s && *s == ';') {
  363. !         if (*str) { /* Don't bother saving a null string */
  364.           newargv[*argc] = savestr(str);
  365.           (*argc)++;
  366.           }
  367.           break;
  368.       }
  369. !     if (*str) {        /* found beginning of a word */
  370.           unq_sep = 0;    /* innocent until proven guilty */
  371. !         s = p = str;
  372.           do  {
  373.           if (p - s >= sizeof buf-1) {
  374.               print("argument list too long.\n");
  375.               return DUBL_NULL;
  376.           }
  377. !         if (*str == ';' || *str == '|')
  378.               unq_sep = final; /* Mark an unquoted separator */
  379. !         if ((*p = *str++) == '\\') {
  380. !             if (final && (*str == ';' || *str == '|'))
  381.               --p; /* Back up to overwrite the backslash */
  382. !             if (*++p = *str) /* assign and compare to NUL */
  383. !             str++;
  384.               continue;
  385.           }
  386.           if (p2 = index("\"'", *p)) {
  387.               register char c2 = *p2;
  388.               /* you can't escape quotes inside quotes of the same type */
  389. !             if (!(p2 = index(str, c2))) {
  390.               if (final)
  391.                   print("Unmatched %c.\n", c2);
  392.               err++;
  393. !             p2 = str;
  394.               }
  395.               /* This is the intent of the following loop:
  396. !              *  tmp = (int)(p2 - str) + 1;
  397. !              *  (void) strncpy(p + !final, str, tmp);
  398.                * The strncpy() can't be used directly because
  399.                * it may be overlapping, which fails sometimes.
  400.                */
  401.               /* copy up to and including quote */
  402. !             for (tmp = 0; tmp < (int)(p2 - str) + 1; tmp++)
  403. !             p[tmp+!final] = str[tmp];
  404.               p += tmp - 2 * !!final; /* change final to a boolean */
  405. !             if (*(str = p2))
  406. !             str++;
  407.           }
  408. !         } while (++p, *str && (!isdelimeter(*str) || str[-1] == '\\'));
  409. !         if (c = *str) /* set c = *str, check for null */
  410. !         str++;
  411.           *p = 0;
  412.           if (*s) {
  413.           /* To differentiate real separators from quoted or
  414. --- 964,1018 ----
  415.        * loop, so unq_sep should always be initialized to 0.
  416.        */
  417.       if (unq_sep && s && *s == ';') {
  418. !         if (*str1) { /* Don't bother saving a null string */
  419.           newargv[*argc] = savestr(str);
  420.           (*argc)++;
  421.           }
  422.           break;
  423.       }
  424. !     if (*str1) {        /* found beginning of a word */
  425.           unq_sep = 0;    /* innocent until proven guilty */
  426. !         s = p = str1;
  427.           do  {
  428.           if (p - s >= sizeof buf-1) {
  429.               print("argument list too long.\n");
  430. +             free(str1);
  431.               return DUBL_NULL;
  432.           }
  433. !         if (*str1 == ';' || *str1 == '|')
  434.               unq_sep = final; /* Mark an unquoted separator */
  435. !         if ((*p = *str1++) == '\\') {
  436. !             if (final && (*str1 == ';' || *str1 == '|'))
  437.               --p; /* Back up to overwrite the backslash */
  438. !             if (*++p = *str1) /* assign and compare to NUL */
  439. !             str1++;
  440.               continue;
  441.           }
  442.           if (p2 = index("\"'", *p)) {
  443.               register char c2 = *p2;
  444.               /* you can't escape quotes inside quotes of the same type */
  445. !             if (!(p2 = index(str1, c2))) {
  446.               if (final)
  447.                   print("Unmatched %c.\n", c2);
  448.               err++;
  449. !             p2 = str1;
  450.               }
  451.               /* This is the intent of the following loop:
  452. !              *  tmp = (int)(p2 - str1) + 1;
  453. !              *  (void) strncpy(p + !final, str1, tmp);
  454.                * The strncpy() can't be used directly because
  455.                * it may be overlapping, which fails sometimes.
  456.                */
  457.               /* copy up to and including quote */
  458. !             for (tmp = 0; tmp < (int)(p2 - str1) + 1; tmp++)
  459. !             p[tmp+!final] = str1[tmp];
  460.               p += tmp - 2 * !!final; /* change final to a boolean */
  461. !             if (*(str1 = p2))
  462. !             str1++;
  463.           }
  464. !         } while (++p, *str1 && (!isdelimeter(*str1) || str1[-1] == '\\'));
  465. !         if (c = *str1) /* set c = *str, check for null */
  466. !         str1++;
  467.           *p = 0;
  468.           if (*s) {
  469.           /* To differentiate real separators from quoted or
  470. ***************
  471. *** 1031,1041 ****
  472.           *p = c;
  473.       }
  474.       }
  475. !     if (!*argc)
  476.       return DUBL_NULL;
  477.       /* newargv[*argc] = NULL; */
  478.       if (!(argv = (char **)calloc((unsigned)((*argc)+1), sizeof(char *)))) {
  479.       perror("mk_argv: calloc");
  480.       return DUBL_NULL;
  481.       }
  482.       for (tmp = 0; tmp < *argc; tmp++)
  483. --- 1035,1048 ----
  484.           *p = c;
  485.       }
  486.       }
  487. !     if (!*argc){
  488. !         free(str1);
  489.       return DUBL_NULL;
  490. +       }
  491.       /* newargv[*argc] = NULL; */
  492.       if (!(argv = (char **)calloc((unsigned)((*argc)+1), sizeof(char *)))) {
  493.       perror("mk_argv: calloc");
  494. +     free(str1);
  495.       return DUBL_NULL;
  496.       }
  497.       for (tmp = 0; tmp < *argc; tmp++)
  498. ***************
  499. *** 1044,1049 ****
  500. --- 1051,1057 ----
  501.       *argc = -1;
  502.       else if (debug > 3)
  503.       (void) printf("Made argv: "), print_argv(argv);
  504. +     free(str1);
  505.       return argv;
  506.   }
  507.   
  508. *** mail.c    Fri Oct 30 13:55:36 1992
  509. --- ../mush-7.2.5/mail.c    Sun Jun 12 16:51:46 1994
  510. ***************
  511. *** 19,25 ****
  512.   static int killme;
  513.   static u_long flags;
  514.   static SIGRET (*oldterm)(), (*oldint)(), (*oldquit)();
  515. ! static int finish_up_letter(), send_it(), start_file();
  516.   static long add_headers();
  517.   static jmp_buf cntrl_c_buf;
  518.   static char *Hfile, *edfile;
  519. --- 19,25 ----
  520.   static int killme;
  521.   static u_long flags;
  522.   static SIGRET (*oldterm)(), (*oldint)(), (*oldquit)();
  523. ! static int finish_up_letter(), send_it(), start_file(), mail_someone();
  524.   static long add_headers();
  525.   static jmp_buf cntrl_c_buf;
  526.   static char *Hfile, *edfile;
  527. *** /dev/null    Tue Jun 21 08:40:28 1994
  528. --- ../mush-7.2.5/makefile.bsdi    Tue Jun 21 11:02:03 1994
  529. ***************
  530. *** 0 ****
  531. --- 1,74 ----
  532. + # makefile.bsdi 
  533. + #
  534. + HDRS= mush.h config.h-dist strings.h bindings.h options.h version.h glob.h pop.h
  535. + SRCS= main.c init.c misc.c mail.c hdrs.c execute.c commands.c print.c dates.c \
  536. +       signals.c setopts.c msgs.c pick.c sort.c expr.c folders.c \
  537. +       loop.c viewopts.c curses.c curs_io.c bind.c file.c strings.c \
  538. +       lock.c macros.c options.c addrs.c malloc.c glob.c command2.c \
  539. +       pop.c pmush.c xcreat.c 
  540. + OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  541. +       signals.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  542. +       folders.o dates.o loop.o viewopts.o curses.o curs_io.o bind.o \
  543. +       lock.o macros.o options.o addrs.o malloc.o glob.o command2.o \
  544. +       pop.o pmush.o xcreat.o 
  545. + HELP_FILES= README README-7.0 README-7.1 README-7.2.0 README-7.2.2 \
  546. +     README-7.2.4 mush.1 cmd_help Mushrc Mailrc Gnurc \
  547. +     sample.mushrc advanced.mushrc digestify
  548. + MAKES= makefile.bsdi makefile.bsd makefile.xenix makefile.sys.v makefile.hpux makefile.sun makefile.solaris
  549. + CFLAGS= -g -DCURSES -DBSD -DSIGRET=void -DBSD44 
  550. + LDFLAGS= -g
  551. + LINTFLAGS= -bxah -Dlint -DCURSES -DBSD
  552. + LIBS= -lcurses -ltermlib -lcompat
  553. + OTHERLIBS=
  554. + # Use some variant of this one if you #define MMDF in config.h
  555. + #OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a
  556. + mush: $(OBJS)
  557. +     @echo loading...
  558. +     @$(CC) $(LDFLAGS) $(OBJS) $(LIBS) $(OTHERLIBS) -o mush
  559. + $(OBJS): config.h mush.h
  560. + loop.o: version.h
  561. + tape:
  562. +     @tar cv $(MAKES) $(HDRS) $(SRCS) $(HELP_FILES)
  563. + tar:
  564. +     @tar fcv MUSH $(MAKES) $(HDRS) $(SRCS) $(HELP_FILES)
  565. + tarmail:
  566. +     tar fcv - $(MAKES) $(HDRS) $(SRCS) $(HELP_FILES) | \
  567. +     compress | btoa > mush.tarmail
  568. + lint:
  569. +     lint $(LINTFLAGS) $(SRCS)
  570. + clean:
  571. +     rm -f *.o core mush
  572. + BINDIR= /usr/local/bin
  573. + LIBDIR= /usr/local/lib
  574. + MRCDIR= /usr/share/misc
  575. + MANDIR= /usr/local/man/man1
  576. + MANEXT= 1
  577. + install: mush
  578. +     mv mush $(BINDIR)
  579. +     strip $(BINDIR)/mush
  580. +     chmod 0755 $(BINDIR)/mush
  581. +     cp mush.1 $(MANDIR)/mush.$(MANEXT)
  582. +     chmod 0644 $(MANDIR)/mush.$(MANEXT)
  583. +     cp cmd_help $(LIBDIR)
  584. +     chmod 0644 $(LIBDIR)/cmd_help
  585. +     cp Mushrc $(MRCDIR)/Mushrc
  586. +     chmod 0644 $(MRCDIR)/Mushrc
  587. + glob: glob.c
  588. +     $(CC) $(CFLAGS) -DTEST -DTEST2 glob.c $(LIBS) $(OTHERLIBS) -o glob
  589. *** /dev/null    Tue Jun 21 08:40:28 1994
  590. --- ../mush-7.2.5/makefile.solaris    Mon Jun 13 18:38:21 1994
  591. ***************
  592. *** 0 ****
  593. --- 1,65 ----
  594. + #
  595. + # Mush makefile for Solaris with gcc 2.5.8
  596. + #
  597. + CC=gcc
  598. + HDRS1= mush.h config.h
  599. + HDRS2= strings.h options.h
  600. + HDRS3= bindings.h glob.h
  601. + HDRS4= version.h pop.h
  602. + SRCS1= commands.c dates.c execute.c expr.c folders.c \
  603. +     hdrs.c init.c loop.c mail.c main.c misc.c msgs.c pick.c \
  604. +     print.c setopts.c signals.c sort.c viewopts.c options.c lock.c
  605. + SRCS2= bind.c curs_io.c curses.c file.c strings.c macros.c \
  606. +     addrs.c malloc.c command2.c pop.c pmush.c xcreat.c glob.c
  607. + OBJS1= commands.o dates.o execute.o expr.o folders.o \
  608. +     hdrs.o init.o loop.o mail.o main.o misc.o msgs.o pick.o \
  609. +     print.o setopts.o signals.o sort.o viewopts.o options.o lock.o
  610. + OBJS2= bind.o curs_io.o curses.o file.o strings.o macros.o \
  611. +     addrs.o malloc.o command2.o pop.o pmush.o xcreat.o glob.o
  612. + HELP= README README-7.0 README-7.1 README-7.2.0 README-7.2.2 \
  613. +     README-7.2.4 mush.1 cmd_help Mushrc Mailrc Gnurc \
  614. +     sample.mushrc advanced.mushrc digestify
  615. + #
  616. + #
  617. + #
  618. + CFLAGS=     -g -DSYSV -DUSG -DCURSES -DSIGRET=void -DSVR4 -DREGCMP
  619. + LDFLAGS=    -g
  620. + LIBS=         -L/usr/ccs/lib -lcurses -lgen -ltermlib
  621. + OTHERLIBS=
  622. + # Use some variant of this one if you #define MMDF in config.h
  623. + #OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a
  624. + PROG=        mush
  625. + $(PROG): $(OBJS1) $(OBJS2)
  626. +     @echo loading...
  627. +     @$(CC) $(LDFLAGS) $(OBJS1) $(OBJS2) -o $(PROG) $(LIBS) $(OTHERLIBS)
  628. + $(OBJS1): $(HDRS1) $(HDRS2)
  629. + $(OBJS2): $(HDRS1) $(HDRS2) $(HDRS3)
  630. + loop.o: version.h
  631. + BINDIR= /usr/local/bin
  632. + LIBDIR= /usr/local/lib
  633. + MRCDIR= /usr/local/lib
  634. + MANDIR= /usr/local/man/man1
  635. + MANEXT= 1
  636. + install: mush
  637. +     cp mush $(BINDIR)
  638. +     strip $(BINDIR)/mush
  639. +     chmod 0755 $(BINDIR)/mush
  640. +     cp mush.1 $(MANDIR)/mush.$(MANEXT)
  641. +     chmod 0644 $(MANDIR)/mush.$(MANEXT)
  642. +     cp cmd_help $(LIBDIR)
  643. +     chmod 0644 $(LIBDIR)/cmd_help
  644. +     cp Mushrc $(MRCDIR)/Mushrc
  645. +     chmod 0644 $(MRCDIR)/Mushrc
  646. + clean: 
  647. +     rm -f *.o mush
  648. + glob: glob.c
  649. +     $(CC) $(LDFLAGS) $(CFLAGS) -DTEST -DTEST2 glob.c -o glob $(LIBS) $(OTHERLIBS)
  650. *** sort.c    Sun Oct 21 21:25:03 1990
  651. --- ../mush-7.2.5/sort.c    Sun Jun 12 16:53:21 1994
  652. ***************
  653. *** 12,23 ****
  654.   
  655.   static int depth, order, ignore_case;
  656.   static jmp_buf sortbuf;
  657.   sort(argc, argv, list)
  658.   register int argc;
  659.   register char *argv[], list[];
  660.   {
  661. -     int msg_cmp();
  662.       SIGRET (*oldint)(), (*oldquit)();
  663.       int n, offset = -1, range = 0;
  664.       long curr_msg_off = msg[current_msg].m_offset;
  665. --- 12,22 ----
  666.   
  667.   static int depth, order, ignore_case;
  668.   static jmp_buf sortbuf;
  669. ! static int msg_cmp();
  670.   sort(argc, argv, list)
  671.   register int argc;
  672.   register char *argv[], list[];
  673.   {
  674.       SIGRET (*oldint)(), (*oldquit)();
  675.       int n, offset = -1, range = 0;
  676.       long curr_msg_off = msg[current_msg].m_offset;
  677. *** strings.c    Wed Jul  4 09:26:33 1990
  678. --- ../mush-7.2.5/strings.c    Sat Jul  2 23:47:33 1994
  679. ***************
  680. *** 69,97 ****
  681.   register char *list1, *list2, *delimiters;
  682.   {
  683.       register char *p, c;
  684.       register int found = 0;
  685.   
  686.       if (!list1 || !list2)
  687.       return 0;
  688. !     if (p = any(list1, delimiters)) {
  689. !     if (p > list1) {
  690.           c = *p; *p = 0;
  691.           /* Check list2 against the first word of list1.
  692.            * Swap places of list2 and list1 to step through list2.
  693.            */
  694. !         found = chk_two_lists(list2, list1, delimiters);
  695.           *p = c;
  696.       }
  697. !     if (found)
  698.           return 1;
  699.       for (p++; *p && index(delimiters, *p); p++)
  700.           ;
  701. !     if (!*p)
  702.           return 0;
  703. !     } else if (!any(list2, delimiters))
  704.       /* Do the trivial case of single words */
  705.       return !lcase_strncmp(list1, list2, -1);
  706.       else
  707.       p = list1;
  708.   
  709. --- 69,114 ----
  710.   register char *list1, *list2, *delimiters;
  711.   {
  712.       register char *p, c;
  713. +     char *list1a;
  714. +     char *list2a;
  715.       register int found = 0;
  716.   
  717.       if (!list1 || !list2)
  718.       return 0;
  719. !     /* duplicate the lists so we can play with them */
  720. !     if ((list1a = savestr(list1)) == NULL)
  721. !       return 0;
  722. !     if ((list2a = savestr(list2)) == NULL){
  723. !       free(list1a);
  724. !       return 0;
  725. !     }
  726. !     if (p = any(list1a, delimiters)) {
  727. !     if (p > list1a) {
  728.           c = *p; *p = 0;
  729.           /* Check list2 against the first word of list1.
  730.            * Swap places of list2 and list1 to step through list2.
  731.            */
  732. !         found = chk_two_lists(list2a, list1a, delimiters);
  733.           *p = c;
  734.       }
  735. !     if (found){
  736. !         free(list1a);
  737. !         free(list2a);
  738.           return 1;
  739. +       }
  740.       for (p++; *p && index(delimiters, *p); p++)
  741.           ;
  742. !     if (!*p){
  743. !         free(list1a);
  744. !         free(list2a);
  745.           return 0;
  746. !       }
  747. !     } else if (!any(list2a, delimiters)){
  748. !         free(list2a);
  749. !     free(list1a);
  750.       /* Do the trivial case of single words */
  751.       return !lcase_strncmp(list1, list2, -1);
  752. +       }
  753.       else
  754.       p = list1;
  755.   
  756. ***************
  757. *** 100,106 ****
  758.        * rest of list1.  This could be more efficient by using a
  759.        * different function to avoid repeating the any() calls.
  760.        */
  761. !     return chk_two_lists(list2, p, delimiters);
  762.   }
  763.   
  764.   bzero(addr, size)
  765. --- 117,126 ----
  766.        * rest of list1.  This could be more efficient by using a
  767.        * different function to avoid repeating the any() calls.
  768.        */
  769. !     found = chk_two_lists(list2a, p, delimiters);
  770. !     free(list2a);
  771. !     free(list1a);
  772. !     return found;
  773.   }
  774.   
  775.   bzero(addr, size)
  776.  
  777.