home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34exe.zip / patches.os2 < prev    next >
Text File  |  1995-01-21  |  16KB  |  574 lines

  1. diff -C 4 mc/orig/mc.c mc/mc.c
  2. *** mc/orig/mc.c    Sat Jan 14 18:34:46 1995
  3. --- mc/mc.c    Sun Jan 15 02:48:38 1995
  4. ***************
  5. *** 28,35 ****
  6. --- 28,39 ----
  7.   char ebuf[MAXSTRLEN+5], *muttfile = "", *include_list[10];
  8.   FILE *lstfile = NULL, *srcfile;
  9.   int errors = 0, warnings = 0, srcline = 0;
  10.   
  11. + #if OS2
  12. + #define optarg Optarg
  13. + #endif
  14.   main(argc,argv) char *argv[];
  15.   {
  16.     extern char *optarg, optltr;        /* in argh.c */
  17.     extern int no_warn, no_gripe;        /* in supp.c */
  18. diff -C 4 me/orig/config.h me/config.h
  19. *** me/orig/config.h    Sat Jan 14 18:36:02 1995
  20. --- me/config.h    Sat Jan 21 16:46:24 1995
  21. ***************
  22. *** 62,70 ****
  23.   #define USE_DEFAULT_MUTT_SEARCH_PATH    1
  24.   #define DEFAULT_MUTT_SEARCH_PATH    "/usr/local/me3:/usr/contrib/me3"
  25.   #endif /* UX_OS */
  26.   
  27. ! #if MSDOZ    /* MS-DOS */
  28.   #define USE_DEFAULT_MUTT_SEARCH_PATH    1
  29.   #define DEFAULT_MUTT_SEARCH_PATH      "C:/me3"            
  30.   #endif /* MSDOZ */
  31.   
  32. --- 62,70 ----
  33.   #define USE_DEFAULT_MUTT_SEARCH_PATH    1
  34.   #define DEFAULT_MUTT_SEARCH_PATH    "/usr/local/me3:/usr/contrib/me3"
  35.   #endif /* UX_OS */
  36.   
  37. ! #if MSDOZ || OS2    /* MS-DOS or OS/2 */
  38.   #define USE_DEFAULT_MUTT_SEARCH_PATH    1
  39.   #define DEFAULT_MUTT_SEARCH_PATH      "C:/me3"            
  40.   #endif /* MSDOZ */
  41.   
  42. diff -C 4 me/orig/help.c me/help.c
  43. *** me/orig/help.c    Sat Jan 14 18:35:38 1995
  44. --- me/help.c    Sun Jan 15 01:08:48 1995
  45. ***************
  46. *** 399,406 ****
  47. --- 399,409 ----
  48.   static char *extensions_to_ignore[] = 
  49.   #if UX_OS
  50.     { ".o", ".mco", NULL };
  51.   #endif
  52. + #if OS2
  53. +   { ".o", ".obj", ".exe", ".com", ".dll", ".dvi", ".mco", NULL };
  54. + #endif
  55.   #if MSDOZ
  56.     { ".OBJ", ".MCO", NULL };
  57.   #endif
  58.   #if ATARI
  59. ***************
  60. *** 432,439 ****
  61. --- 435,445 ----
  62.     while (n--)
  63.     {
  64.   #if MSDOZ
  65.       lowercase(ptr);
  66. + #endif
  67. + #if OS2
  68. +     _fnlwr(ptr);
  69.   #endif
  70.       *qtr++ = ptr;
  71.       while (*ptr++) ;
  72.     }
  73. diff -C 4 me/orig/main.c me/main.c
  74. *** me/orig/main.c    Sat Jan 14 18:35:42 1995
  75. --- me/main.c    Sun Jan 15 01:34:50 1995
  76. ***************
  77. *** 82,93 ****
  78.        *   Every time anything is done, the display probably needs updating.
  79.        *   Every time a Mutt program is run, the current buffer could get
  80.        *       outta sync with the current window.
  81.        */
  82. ! main(argc,argv) int argc; char *argv[];
  83.   {
  84.     int n;
  85.     register EKeyCode kc;
  86.   
  87.       /* Get everything ready to go */
  88.     zargc = argc; zargv = argv;
  89.     edinit(SCRATCH_BUFFER);
  90. --- 82,98 ----
  91.        *   Every time anything is done, the display probably needs updating.
  92.        *   Every time a Mutt program is run, the current buffer could get
  93.        *       outta sync with the current window.
  94.        */
  95. ! main(argc,argv) int argc; char **argv;
  96.   {
  97.     int n;
  98.     register EKeyCode kc;
  99. + #if OS2
  100. +   /* do wildcard expansion, since the shell won't */
  101. +   _wildcard(&argc, &argv);
  102. + #endif
  103.   
  104.       /* Get everything ready to go */
  105.     zargc = argc; zargv = argv;
  106.     edinit(SCRATCH_BUFFER);
  107. diff -C 4 me/orig/os.c me/os.c
  108. *** me/orig/os.c    Sat Jan 14 18:35:52 1995
  109. --- me/os.c    Sun Jan 15 01:40:14 1995
  110. ***************
  111. *** 285,293 ****
  112.   
  113.   /* ******************************************************************** */
  114.   /* **************************** atariST Stuff ************************* */
  115.   /* ******************************************************************** */
  116. ! #if ATARI
  117.   
  118.   #define PSEP ';'        /* search path separater */
  119.   
  120.      /* !!!Having a fixed size array is asking for trouble.  Especially on
  121. --- 285,293 ----
  122.   
  123.   /* ******************************************************************** */
  124.   /* **************************** atariST Stuff ************************* */
  125.   /* ******************************************************************** */
  126. ! #if ATARI || OS2
  127.   
  128.   #define PSEP ';'        /* search path separater */
  129.   
  130.      /* !!!Having a fixed size array is asking for trouble.  Especially on
  131. ***************
  132. *** 302,310 ****
  133.     static char msp[NFILEN];    /* Filled with '\0'  !!!asking for trouble */
  134.   
  135.     char *ptr;
  136.   
  137. !   que_version_info("OS", "Atari", "", (char *)NULL);
  138.   
  139.     canonize(".", current_dir, (char *)NULL);
  140.   
  141.     mutt_search_path = getenv(MUTT_ENV_VAR);
  142. --- 302,316 ----
  143.     static char msp[NFILEN];    /* Filled with '\0'  !!!asking for trouble */
  144.   
  145.     char *ptr;
  146.   
  147. !   que_version_info("OS", 
  148. ! #if ATARI
  149. !     "Atari", "",
  150. ! #elif OS2
  151. !     "OS/2", "2", "0+",
  152. ! #endif
  153. !     (char *)NULL);
  154.   
  155.     canonize(".", current_dir, (char *)NULL);
  156.   
  157.     mutt_search_path = getenv(MUTT_ENV_VAR);
  158. ***************
  159. *** 329,336 ****
  160. --- 335,347 ----
  161.   {
  162.     return current_dir;
  163.   }
  164.   
  165. + #if OS2
  166. + /* change drive and directory */
  167. + # define chdir _chdir2
  168. + #endif
  169.       /* Notes:
  170.        *   Same as Unix change_directory()
  171.        */
  172.   change_directory(directory) char *directory;
  173. ***************
  174. *** 356,364 ****
  175.   /* ******************************************************************** */
  176.   /* ************** Unix, MS-DOS and atariST Stuff ********************** */
  177.   /* ******************************************************************** */
  178.   
  179. ! #if UX_OS || MSDOZ || ATARI
  180.   
  181.      /* find_file:  Look around the file system for a file.
  182.       * Input:
  183.       *   name:  Name of the file to look for.  May have a leading path.
  184. --- 367,375 ----
  185.   /* ******************************************************************** */
  186.   /* ************** Unix, MS-DOS and atariST Stuff ********************** */
  187.   /* ******************************************************************** */
  188.   
  189. ! #if UX_OS || MSDOZ || ATARI || OS2
  190.   
  191.      /* find_file:  Look around the file system for a file.
  192.       * Input:
  193.       *   name:  Name of the file to look for.  May have a leading path.
  194. ***************
  195. *** 383,391 ****
  196.     char buf[NFILEN +80], *ptr, *qtr;
  197.     int n;
  198.   
  199.     if (strchr(name,U_SLASH)
  200. ! #if MSDOZ || ATARI    /* MS-DOS "A:foo" */
  201.         || strchr(name,M_SLASH) || name[1] == ':'
  202.   #endif
  203.     )
  204.     {
  205. --- 394,402 ----
  206.     char buf[NFILEN +80], *ptr, *qtr;
  207.     int n;
  208.   
  209.     if (strchr(name,U_SLASH)
  210. ! #if MSDOZ || ATARI || OS2    /* MS-DOS "A:foo" */
  211.         || strchr(name,M_SLASH) || name[1] == ':'
  212.   #endif
  213.     )
  214.     {
  215. ***************
  216. *** 415,423 ****
  217.   /* ******************************************************************** */
  218.   /* ********************** Unix and atariST Stuff ********************** */
  219.   /* ******************************************************************** */
  220.   
  221. ! #if UX_OS || ATARI
  222.   
  223.       /* Return the current time and date.
  224.        * If you can't do this, return zeros and FALSE.
  225.        * Data formats:
  226. --- 426,434 ----
  227.   /* ******************************************************************** */
  228.   /* ********************** Unix and atariST Stuff ********************** */
  229.   /* ******************************************************************** */
  230.   
  231. ! #if UX_OS || ATARI || OS2
  232.   
  233.       /* Return the current time and date.
  234.        * If you can't do this, return zeros and FALSE.
  235.        * Data formats:
  236. diff -C 4 me/orig/spawn.c me/spawn.c
  237. *** me/orig/spawn.c    Sat Jan 14 18:35:56 1995
  238. --- me/spawn.c    Sat Jan 21 13:51:22 1995
  239. ***************
  240. *** 85,93 ****
  241.   #endif /* UX_OS */
  242.   
  243.   
  244.   
  245. ! #if ATARI
  246.     register char *ptr;
  247.   
  248.     if (dont_spawn) return FALSE;
  249.   
  250. --- 85,93 ----
  251.   #endif /* UX_OS */
  252.   
  253.   
  254.   
  255. ! #if ATARI || OS2
  256.     register char *ptr;
  257.   
  258.     if (dont_spawn) return FALSE;
  259.   
  260. ***************
  261. *** 98,105 ****
  262. --- 98,108 ----
  263.     {
  264.       close_display(TRUE);      /* restore terminal for normal user interface */
  265.       if ((ptr = getenv("SHELL")) != NULL && *ptr != '\0')
  266.       system(ptr);            /* system("/bin/ksh"); */
  267. + #if OS2
  268. +     else system("cmd.exe");        /* default shell */
  269. + #endif
  270.       open_display();        /* set up terminal for editor */
  271.     }
  272.     return TRUE;
  273.   #endif    /* ATARI */
  274. ***************
  275. *** 133,141 ****
  276.   
  277.     if (ask)        /* restore terminal for normal user interface */
  278.       close_display(FALSE);
  279.   
  280. ! #if UX_OS || MSDOZ || ATARI
  281.     if (ask) t_putchar('\n');  /* so the cmd doesn't overwrite the minibuffer */
  282.     s = system(command);        /* !!!??? returns -1 or command return code */
  283.   #endif /* UX_OS || MSDOZ || ATARI */
  284.   
  285. --- 136,144 ----
  286.   
  287.     if (ask)        /* restore terminal for normal user interface */
  288.       close_display(FALSE);
  289.   
  290. ! #if UX_OS || MSDOZ || ATARI || OS2
  291.     if (ask) t_putchar('\n');  /* so the cmd doesn't overwrite the minibuffer */
  292.     s = system(command);        /* !!!??? returns -1 or command return code */
  293.   #endif /* UX_OS || MSDOZ || ATARI */
  294.   
  295. ***************
  296. *** 250,255 ****
  297. --- 253,261 ----
  298.     if (in_bag) unlink(fin);
  299.     else          open_display();
  300.   #endif
  301.   
  302. + #if OS2
  303. +   ttopen();    /* reset the keyboard -- I was losing ^S and ^C */
  304. + #endif
  305.     return s;
  306.   }
  307. diff -C 4 util/orig/argh.c util/argh.c
  308. *** util/orig/argh.c    Sat Jan 14 18:35:10 1995
  309. --- util/argh.c    Sat Jan 21 14:22:00 1995
  310. ***************
  311. *** 16,23 ****
  312. --- 16,30 ----
  313.   #include <stdio.h>
  314.   #include <ctype.h>
  315.   #include "const.h"
  316.   
  317. + #if __EMX__    /* don't include os.h, so OS2 isn't defined */
  318. + /* the emx getopt code is being linked in for some reason, and this
  319. +  * conflicts
  320. +  */
  321. + #define optarg Optarg
  322. + #endif
  323.       /* the next 3 vars are to be used by the calling pgm */
  324.   char *optarg,        /* pointer to word */
  325.        optltr;        /* option letter */
  326.   int opterr = TRUE;    /* tell errors?    */
  327. diff -C 4 util/orig/canonize.c util/canonize.c
  328. *** util/orig/canonize.c    Sat Jan 14 18:35:16 1995
  329. --- util/canonize.c    Tue Jan 17 00:39:50 1995
  330. ***************
  331. *** 115,128 ****
  332.   
  333.       /* Ensure file name is not empty ie contains at least "c\0" */
  334.     if (*fnptr == '\0') return NULL;
  335.   
  336. ! #if MSDOZ
  337.     if (fnptr[1] == ':')        /* if drive provided, use it */
  338.       { *cnptr++ = toupper(*fnptr); fnptr += 2; }
  339.     else *cnptr++ = 'A' + GET_DRIVE();    /* drive missing: use current drive */
  340.     *cnptr++ = ':';
  341. ! #endif    /* MSDOZ */
  342.   
  343.     first_slash = cnptr;                /* point to opening slash */
  344.     if (ISSLASH(*fnptr))
  345.     {
  346. --- 115,132 ----
  347.   
  348.       /* Ensure file name is not empty ie contains at least "c\0" */
  349.     if (*fnptr == '\0') return NULL;
  350.   
  351. ! #if MSDOZ || OS2
  352.     if (fnptr[1] == ':')        /* if drive provided, use it */
  353.       { *cnptr++ = toupper(*fnptr); fnptr += 2; }
  354. + #if MSDOZ
  355.     else *cnptr++ = 'A' + GET_DRIVE();    /* drive missing: use current drive */
  356. + #else
  357. +   else *cnptr++ = _getdrive();
  358. + #endif
  359.     *cnptr++ = ':';
  360. ! #endif    /* MSDOZ || OS2 */
  361.   
  362.     first_slash = cnptr;                /* point to opening slash */
  363.     if (ISSLASH(*fnptr))
  364.     {
  365. ***************
  366. *** 147,154 ****
  367. --- 151,170 ----
  368.         for (; *cnptr; cnptr++) if (*cnptr == M_SLASH) *cnptr = U_SLASH; 
  369.         *cnptr++ = U_SLASH;
  370.       }
  371.   #else
  372. + #if OS2
  373. +     if (current_directory && *current_directory == *cname)    /* better be canonized */
  374. +     strcpy(cname,current_directory);
  375. +     else if (_getcwd1(cnptr,cname[0]) == -1) return NULL;    /* at least a "/" */
  376. +     while (*cnptr) {        /* move to end of current directory */
  377. +      if (ISSLASH(*cnptr))
  378. +        *cnptr = U_SLASH;    /* _getcwd1 is supposed to do this ... */
  379. +       cnptr++;
  380. +       }
  381. +     if (cnptr[-1] != U_SLASH) *cnptr++ = U_SLASH;   /* in case cd is "/" */
  382. + #else
  383.   
  384.   #if UX_OS
  385.       if (current_directory)        /* better be canonized */
  386.       strcpy(cnptr,current_directory);
  387. ***************
  388. *** 170,177 ****
  389. --- 186,194 ----
  390.       /* Nothing defined, nuke the compile */
  391.       Need_to_define = Something;
  392.   #endif  /* ATARI */
  393.   #endif  /* UX_OS */
  394. + #endif  /* OS2 */
  395.   #endif    /* MSDOZ */
  396.     }
  397.   
  398.     while (TRUE)
  399. ***************
  400. *** 190,197 ****
  401. --- 207,219 ----
  402.   
  403.   #if MSDOZ
  404.     lowercase(first_slash);    /* lowercase all but drive */
  405.   #endif    /* MSDOZ */
  406. + #if OS2
  407. +   _fnlwr(cname);        /* lowercase on all-uppercase drives */
  408. + #endif
  409.     return cname;
  410.   }
  411.   
  412.       /* know: cnptr[-1] == slash */
  413. diff -C 4 util/orig/fname.c util/fname.c
  414. *** util/orig/fname.c    Sat Jan 14 18:35:12 1995
  415. --- util/fname.c    Sun Jan 15 00:35:22 1995
  416. ***************
  417. *** 36,49 ****
  418.       ptr--;
  419.       if (ISSLASH(*ptr))
  420.       {
  421.         if (ptr == fname) ptr++;            /* /, /foo */
  422. ! #if MSDOZ || ATARI
  423.         else if (ptr[-1] == DRIVE) ptr++;        /* A:/, A:/foo */
  424.   #endif
  425.         break;
  426.       }
  427. ! #if MSDOZ || ATARI
  428.       if (*ptr == DRIVE) { ptr++; break; }    /* A:, A:foo */
  429.   #endif
  430.     }
  431.     if (*ptr == DOT)            /* might have . or .. */
  432. --- 36,49 ----
  433.       ptr--;
  434.       if (ISSLASH(*ptr))
  435.       {
  436.         if (ptr == fname) ptr++;            /* /, /foo */
  437. ! #if MSDOZ || ATARI || OS2
  438.         else if (ptr[-1] == DRIVE) ptr++;        /* A:/, A:/foo */
  439.   #endif
  440.         break;
  441.       }
  442. ! #if MSDOZ || ATARI || OS2
  443.       if (*ptr == DRIVE) { ptr++; break; }    /* A:, A:foo */
  444.   #endif
  445.     }
  446.     if (*ptr == DOT)            /* might have . or .. */
  447. diff -C 4 util/orig/fxpand.c util/fxpand.c
  448. *** util/orig/fxpand.c    Sat Jan 14 18:35:16 1995
  449. --- util/fxpand.c    Sat Jan 21 13:23:00 1995
  450. ***************
  451. *** 127,135 ****
  452.   
  453.   fxpand(name, onlyone,nopath,slash_dir, name_heap,process_fname)
  454.     char *name,*name_heap; pfi process_fname;
  455.   {
  456. !   char path[128], word[100], *ptr, *qtr, tbuf[128];
  457.     File_Info de;
  458.     int atend, eval, found, needadot, path_len, s;
  459.   
  460.     if (name_heap)    /* store the found file names in name_heap */
  461. --- 127,135 ----
  462.   
  463.   fxpand(name, onlyone,nopath,slash_dir, name_heap,process_fname)
  464.     char *name,*name_heap; pfi process_fname;
  465.   {
  466. !   char path[_MAX_PATH], word[100], *ptr, *qtr, tbuf[_MAX_PATH];
  467.     File_Info de;
  468.     int atend, eval, found, needadot, path_len, s;
  469.   
  470.     if (name_heap)    /* store the found file names in name_heap */
  471. ***************
  472. *** 236,243 ****
  473. --- 236,249 ----
  474.   #define GOTTA_EVAL    case '?': case '[': case '*'
  475.   
  476.   #endif    /* MSDOZ */
  477.   
  478. + /* emx provides unix-like directory routines.  It can use dirent or direct */
  479. + #if OS2
  480. + #undef ATARI
  481. + #define ATARI 1        /* the atari code does what we want with slashes */
  482. + #endif
  483.   
  484.   #if ATARI    /* Atari has Posix opendir(), etc */
  485.   #undef  POSIX_OS
  486.   #define POSIX_OS 1    /* turn on POSIX and UX_OS */
  487. diff -C 4 util/orig/os.h util/os.h
  488. *** util/orig/os.h    Sat Jan 14 18:35:08 1995
  489. --- util/os.h    Sat Jan 21 13:27:00 1995
  490. ***************
  491. *** 23,35 ****
  492.   #endif
  493.   
  494.   #define ATARI        0    /* AtariST/TT TOS or MiNT */
  495.   
  496. ! #define OS2             0    /* OS/2 */
  497. ! #if OS2
  498. ! #undef  MSDOZ
  499. ! #define MSDOZ 1
  500.   #endif
  501.   
  502.   #define AMIGA        0    /* AmigaDOS !NOT SUPPORTED! */
  503.   
  504. --- 23,37 ----
  505.   #endif
  506.   
  507.   #define ATARI        0    /* AtariST/TT TOS or MiNT */
  508.   
  509. ! #ifdef __EMX__        /* emx/gcc compiler for OS/2 (and sometimes DOS) */
  510. ! #define OS2             1    /* OS/2 */
  511. ! /* this is different enough from MSDOZ that I don't define MSDOZ.
  512. !  * It's actually similar to ATARI.
  513. !  */
  514. ! #else
  515. ! #define OS2        0
  516.   #endif
  517.   
  518.   #define AMIGA        0    /* AmigaDOS !NOT SUPPORTED! */
  519.   
  520. ***************
  521. *** 98,106 ****
  522.   
  523.   #define M_SLASH '\\'    /* file seperator for MS-DOS */
  524.   #define U_SLASH '/'    /* file seperator for UN*X */
  525.   
  526. ! #if MSDOZ || ATARI
  527.   #define ISSLASH(c) ((c) == U_SLASH || (c) == M_SLASH)
  528.   #else
  529.   #define ISSLASH(c) ((c) == U_SLASH)
  530.   #endif /* MSDOZ || ATARI */
  531. --- 100,108 ----
  532.   
  533.   #define M_SLASH '\\'    /* file seperator for MS-DOS */
  534.   #define U_SLASH '/'    /* file seperator for UN*X */
  535.   
  536. ! #if MSDOZ || ATARI || OS2
  537.   #define ISSLASH(c) ((c) == U_SLASH || (c) == M_SLASH)
  538.   #else
  539.   #define ISSLASH(c) ((c) == U_SLASH)
  540.   #endif /* MSDOZ || ATARI */
  541. diff -C 4 util/orig/wildmat.c util/wildmat.c
  542. *** util/orig/wildmat.c    Sat Jan 14 18:35:08 1995
  543. --- util/wildmat.c    Sun Jan 15 00:33:42 1995
  544. ***************
  545. *** 61,69 ****
  546.       for ( ; *p; text++, p++) {
  547.       if (*text == '\0' && *p != '*')
  548.           return ABORT;
  549.       switch (*p) {
  550. ! #if !(MSDOZ || ATARI)        /* blame those bozos at Microsoft */
  551.       case '\\':
  552.           /* Literal match with following character. */
  553.           p++;
  554.           /* FALLTHROUGH */
  555. --- 61,69 ----
  556.       for ( ; *p; text++, p++) {
  557.       if (*text == '\0' && *p != '*')
  558.           return ABORT;
  559.       switch (*p) {
  560. ! #if !(MSDOZ || ATARI || OS2)        /* blame those bozos at Microsoft */
  561.       case '\\':
  562.           /* Literal match with following character. */
  563.           p++;
  564.           /* FALLTHROUGH */
  565.