home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume39 / ncftp / patch06 < prev    next >
Text File  |  1993-09-20  |  20KB  |  798 lines

  1. Newsgroups: comp.sources.misc
  2. From: mgleason@cse.unl.edu (Mike Gleason)
  3. Subject: v39i092:  ncftp - Alternative User Interface for FTP, v1.5, Patch06
  4. Message-ID: <1993Sep20.165319.17049@sparky.sterling.com>
  5. X-Md4-Signature: 233ca844591a35914a701745646a6167
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: NCEMRSoft
  8. Date: Mon, 20 Sep 1993 16:53:19 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
  12. Posting-number: Volume 39, Issue 92
  13. Archive-name: ncftp/patch06
  14. Environment: UNIX, ANSI-C, !SVR4
  15. Patch-To: ncftp: Volume 39, Issue 53-57
  16.  
  17. This is the sixth official patch to ncftp 1.5.  This patch fixes 
  18. a bug in 'put' adds SCO Xenix support, and some other little things.
  19.  
  20. As usual, you'll need the sources with all the previous patches applied
  21. for this to work.
  22.  
  23. There are supposed to be tabs in this patch. Make sure your newsreader isn't
  24. converting them to spaces; if you have problems you may want to check to see
  25. if your 'patch' program can handle munged tabs (like patch -l, perhaps).
  26.  
  27. I'll put up the whole 1.5.6 distribution up for ftp as:
  28.   cse.unl.edu:/pub/mgleason/ncftp156.tar.z
  29. Don't call during business hours -- you won't be able to download it.
  30.  
  31.  * v1.5.6 - September 20, 1993.
  32.  *  Fixed bug in put, caused by "indent."  Checking for '.gz' extension
  33.  *  for gzip in addition to '.z'.  A little better at preserving the
  34.  *  transfer type.  Changed a syslog() call to use than 6 arguments,
  35.  *  and reporting the full remote path to the system log now.  Have to
  36.  *  explicitly define GZCAT in order to try paging gzip files now.
  37.  *  Setting the current hostname correctly if using the gateway code.
  38.  *  A lot of hacks added for SCO Xenix support: 1.  Can add -DNO_STRSTR
  39.  *  to use own strstr();  2.  Can add -DNO_STRFTIME to make % flags in the
  40.  *  prompt optional;  3. Can add -DNO_RENAME if you do not have rename(),
  41.  *  or rename() doesn't work;  4. Added PTRTYPE if void ptrs are a problem.
  42.  */
  43.  
  44. diff -c ./Makefile ../ncftp156/Makefile
  45. *** ./Makefile    Thu Sep 16 20:21:31 1993
  46. --- ../ncftp156/Makefile    Mon Sep 20 00:03:50 1993
  47. ***************
  48. *** 171,176 ****
  49. --- 171,179 ----
  50.       -@ls -l $(NAME)
  51.       -@echo 'Done.'
  52.   
  53. + clean:
  54. +     rm -f $(OBJS) $(NAME)
  55.   # Dependencies:
  56.   cmds.o: cmds.c 
  57.   cmds.o: sys.h 
  58. diff -c ./README ../ncftp156/README
  59. *** ./README    Thu Sep 16 20:21:31 1993
  60. --- ../ncftp156/README    Mon Sep 20 00:03:50 1993
  61. ***************
  62. *** 114,119 ****
  63. --- 114,121 ----
  64.       SCO Unix:  Add -DSCO324 or -DSCO322 (as appropriate) to SDEFS,
  65.         and -lsocket to LIBS.
  66.   
  67. +     SCO Xenix 2.3.4: Add -DSCOXNX to SDEFS and add "-lsocket -ldir" to LIBS.
  68.       Bull DPX/2: Add -DBULL to SDEFS, add -linet to LIBS, and
  69.         use gcc.
  70.   
  71. ***************
  72. *** 175,180 ****
  73. --- 177,196 ----
  74.   a remote host.  I'm told that this happens because of some problem in System
  75.   V's sockets don't like fprintf (and memcpy).
  76.   
  77. + *  Add -DPTRTYPE=char if your pre-ANSI compiler complains about the
  78. + way malloc() or free() are used, and in general does not like (void *)
  79. + as a generic pointer type.
  80. + *  Add -DNO_STRFTIME if your system does not have strftime().  If you do,
  81. + we won't try to use it.  This means, however, you cannot use ``%'' values
  82. + in your prompt.
  83. + *  Add -DNO_RENAME if your system does not have rename() (or the one it
  84. + has is broken).  If you do, we will use our own.
  85. + * Add -DNO_STRSTR if your system does not have strstr().  If you do, we
  86. + will use our own.
  87.   *  (Optional) Add -DGETCWDSIZET if your system's getcwd() takes a size_t
  88.   as the second parameter instead of an int.
  89.   
  90. ***************
  91. *** 201,206 ****
  92. --- 217,227 ----
  93.   ------------------------
  94.   
  95.   Add these as applicable to the PDEFS line in the Makefile.
  96. + * -DGZCAT="path": If you have the GNU gzip package installed on your system,
  97. +     the program can try paging remote files compressed with gzip _and_ 
  98. +     compress (instead of just compress).  Add -DGZCAT=\"/full/path/to/zcat\"
  99. +     with GZCAT set to the path name of GNU's zcat/gzcat.
  100.   
  101.   *   -DCURSES:  Uses curses library to display boldface, underline, etc.
  102.       By default ncftp uses hard-coded ANSI escapes (^[[1m etc.) to
  103. diff -c ./cmds.c ../ncftp156/cmds.c
  104. *** ./cmds.c    Thu Sep 16 20:21:23 1993
  105. --- ../ncftp156/cmds.c    Mon Sep 20 00:03:49 1993
  106. ***************
  107. *** 333,339 ****
  108.               (void) printf("%s\n", globerr);
  109.               if (gargs) {
  110.                   blkfree(gargs);
  111. !                 free(gargs);
  112.               }
  113.               continue;
  114.           }
  115. --- 333,339 ----
  116.               (void) printf("%s\n", globerr);
  117.               if (gargs) {
  118.                   blkfree(gargs);
  119. !                 Free(gargs);
  120.               }
  121.               continue;
  122.           }
  123. ***************
  124. *** 350,356 ****
  125.           }
  126.           if (gargs != NULL) {
  127.               blkfree(gargs);
  128. !             free(gargs);
  129.           }
  130.       }
  131.       (void) Signal(SIGINT, oldintr);
  132. --- 350,356 ----
  133.           }
  134.           if (gargs != NULL) {
  135.               blkfree(gargs);
  136. !             Free(gargs);
  137.           }
  138.       }
  139.       (void) Signal(SIGINT, oldintr);
  140. ***************
  141. *** 412,418 ****
  142.       string local_file;
  143.       char remote_file[256];
  144.       char *cp;
  145. !     int oldtype = curtype;
  146.   
  147.       /* paging mode is set if the command name is 'page' or 'more.' */
  148.       paging = (**argv != 'g');
  149. --- 412,419 ----
  150.       string local_file;
  151.       char remote_file[256];
  152.       char *cp;
  153. !     int oldtype = curtype, try_zcat;
  154. !     size_t len;
  155.   
  156.       /* paging mode is set if the command name is 'page' or 'more.' */
  157.       paging = (**argv != 'g');
  158. ***************
  159. *** 429,441 ****
  160.           return CMDERR;
  161.   
  162.       if (paging) {
  163. !         size_t len = strlen(remote_file);
  164.   
  165. !         /* Run compressed remote files through zcat, then the pager. */
  166. !         if (strlen(remote_file) > (size_t)2 &&
  167. !             (remote_file[len - 1] == 'Z' || remote_file[len - 1] == 'z') &&
  168. !             remote_file[len - 2] == '.')
  169. !         {
  170.               (void) _settype("b");
  171.               (void) sprintf(local_file, "|%s ", ZCAT);
  172.               argv[2] = Strncat(local_file, pager);
  173. --- 430,465 ----
  174.           return CMDERR;
  175.   
  176.       if (paging) {
  177. !         try_zcat = 0;
  178. !         len = strlen(remote_file);
  179.   
  180. !         if (len > (size_t) 2) {
  181. !              if (remote_file[len-2] == '.') {
  182. !                 /* Check for .Z files. */
  183. !                 if (remote_file[len-1] == 'Z')
  184. !                     try_zcat = 1;
  185. ! #ifdef GZCAT
  186. !                 /* Check for .z (gzip) files. */
  187. !                 if (remote_file[len-1] == 'z')
  188. !                     try_zcat = 1;
  189. ! #endif    /* GZCAT */
  190. !             }
  191. !         }
  192. ! #ifdef GZCAT
  193. !         if (len > (size_t) 3) {
  194. !             /* Check for ".gz" (gzip) files. */
  195. !             if (strcmp(remote_file + len - 3, ".gz") == 0)
  196. !                 try_zcat = 1;
  197. !         }
  198. ! #endif    /* GZCAT */
  199. !         /* Run compressed remote files through zcat, then the pager.
  200. !          * If GZCAT was defined, we also try paging gzipped files.
  201. !          * Note that ZCAT is defined to be GZCAT if you defined
  202. !          * GZCAT.
  203. !          */
  204. !          if (try_zcat) {
  205.               (void) _settype("b");
  206.               (void) sprintf(local_file, "|%s ", ZCAT);
  207.               argv[2] = Strncat(local_file, pager);
  208. ***************
  209. *** 1242,1248 ****
  210.           (void) printf("%s: %s\n", *cpp, globerr);
  211.           if (globbed) {
  212.               blkfree(globbed);
  213. !             free(globbed);
  214.           }
  215.           return (0);
  216.       }
  217. --- 1266,1272 ----
  218.           (void) printf("%s: %s\n", *cpp, globerr);
  219.           if (globbed) {
  220.               blkfree(globbed);
  221. !             Free(globbed);
  222.           }
  223.           return (0);
  224.       }
  225. ***************
  226. *** 1251,1257 ****
  227.           /* don't waste too much memory */
  228.           if (*globbed) {
  229.               blkfree(globbed);
  230. !             free(globbed);
  231.           }
  232.       }
  233.       return (1);
  234. --- 1275,1281 ----
  235.           /* don't waste too much memory */
  236.           if (*globbed) {
  237.               blkfree(globbed);
  238. !             Free(globbed);
  239.           }
  240.       }
  241.       return (1);
  242. ***************
  243. *** 1811,1816 ****
  244. --- 1835,1843 ----
  245.   #ifdef NO_TIPS
  246.       DStrs[nDStrs++] = "NO_TIPS";
  247.   #endif
  248. + #ifdef GZCAT
  249. +     DStrs[nDStrs++] = "GZCAT";
  250. + #endif
  251.   #ifdef NO_UTIMEH 
  252.       DStrs[nDStrs++] = "NO_UTIMEH";
  253.   #endif
  254. ***************
  255. *** 1823,1828 ****
  256. --- 1850,1864 ----
  257.   #ifdef NO_MKTIME
  258.       DStrs[nDStrs++] = "NO_MKTIME";
  259.   #endif
  260. + #ifdef NO_STRSTR
  261. +     DStrs[nDStrs++] = "NO_STRSTR";
  262. + #endif
  263. + #ifdef NO_STRFTIME
  264. +     DStrs[nDStrs++] = "NO_STRFTIME";
  265. + #endif
  266. + #ifdef NO_RENAME
  267. +     DStrs[nDStrs++] = "NO_RENAME";
  268. + #endif
  269.   #ifdef TRY_ABOR
  270.       DStrs[nDStrs++] = "TRY_ABOR";
  271.   #endif
  272. ***************
  273. *** 1884,1890 ****
  274.           b = a->next;
  275.           if (a->string)
  276.               free(a->string);    /* free string */
  277. !         free(a);                /* free node */
  278.           a = b;
  279.       }
  280.       lshead = lstail = NULL;
  281. --- 1920,1926 ----
  282.           b = a->next;
  283.           if (a->string)
  284.               free(a->string);    /* free string */
  285. !         Free(a);         /* free node */
  286.           a = b;
  287.       }
  288.       lshead = lstail = NULL;
  289. diff -c ./defaults.h ../ncftp156/defaults.h
  290. *** ./defaults.h    Thu Sep 16 20:21:30 1993
  291. --- ../ncftp156/defaults.h    Mon Sep 20 00:03:49 1993
  292. ***************
  293. *** 18,24 ****
  294.   
  295.   #ifndef ZCAT                    /* Usually "zcat," but use the full pathname */
  296.                                   /* if possible. */
  297. ! #define ZCAT "zcat"
  298.   #endif
  299.   
  300.   #ifndef MAX_XFER_BUFSIZE
  301. --- 18,30 ----
  302.   
  303.   #ifndef ZCAT                    /* Usually "zcat," but use the full pathname */
  304.                                   /* if possible. */
  305. ! #ifdef GZCAT                    /* If you said you had gnu's zcat, use it
  306. !                                  * since it can do .Z files too.
  307. !                                  */
  308. ! #    define ZCAT GZCAT
  309. ! #else
  310. ! #    define ZCAT "zcat"
  311. ! #endif
  312.   #endif
  313.   
  314.   #ifndef MAX_XFER_BUFSIZE
  315. diff -c ./ftp.c ../ncftp156/ftp.c
  316. *** ./ftp.c    Thu Sep 16 20:21:24 1993
  317. --- ../ncftp156/ftp.c    Mon Sep 20 00:03:49 1993
  318. ***************
  319. *** 790,811 ****
  320.       }
  321.       
  322.       /* Save transfers to the logfile. */
  323.       if (logf != NULL) {
  324. -         /* if a simple path is given, try to log the full path */
  325. -         if (rindex(remote, '/') == NULL && cwd != NULL) {
  326. -             (void) sprintf(str, "%s/%s", cwd, remote);
  327. -              cp = str;
  328. -         } else
  329. -             cp = remote;
  330.           (void) fprintf(logf, "\t-> \"%s\" %s, %.2f %s", cp, direction, bs, bsstr);
  331.       } 
  332.   #ifdef SYSLOG
  333.       if (direction[0] == 'r')
  334. !         syslog (LOG_INFO, "%s %s %s as %s from %s (%ld bytes).",
  335. !             uinfo.username, direction, remote, local, hostname, bytes);
  336.       else
  337. !         syslog (LOG_INFO, "%s %s %s as %s to %s (%ld bytes).",
  338. !             uinfo.username, direction, local, remote, hostname, bytes);
  339.   #endif
  340.   }   /* end_progress */
  341.   
  342. --- 790,811 ----
  343.       }
  344.       
  345.       /* Save transfers to the logfile. */
  346. +     /* if a simple path is given, try to log the full path */
  347. +     if (rindex(remote, '/') == NULL && cwd != NULL) {
  348. +         (void) sprintf(str, "%s/%s", cwd, remote);
  349. +          cp = str;
  350. +     } else
  351. +         cp = remote;
  352.       if (logf != NULL) {
  353.           (void) fprintf(logf, "\t-> \"%s\" %s, %.2f %s", cp, direction, bs, bsstr);
  354.       } 
  355.   #ifdef SYSLOG
  356.       if (direction[0] == 'r')
  357. !         syslog (LOG_INFO, "%s received %s as %s from %s (%ld bytes).",
  358. !             uinfo.username, cp, local, hostname, bytes);
  359.       else
  360. !         syslog (LOG_INFO, "%s sent %s as %s to %s (%ld bytes).",
  361. !             uinfo.username, local, cp, hostname, bytes);
  362.   #endif
  363.   }   /* end_progress */
  364.   
  365. ***************
  366. *** 939,945 ****
  367.   #else
  368.        if (remote) {
  369.            (void) sprintf(str, "%s %s", cmd, remote);
  370. !          if (command(str) == PRELIM) {
  371.                (void) Signal(SIGINT, oldintr);
  372.                if (oldintp)
  373.                    (void) Signal(SIGPIPE, oldintp);
  374. --- 939,945 ----
  375.   #else
  376.        if (remote) {
  377.            (void) sprintf(str, "%s %s", cmd, remote);
  378. !          if (command(str) != PRELIM) {
  379.                (void) Signal(SIGINT, oldintr);
  380.                if (oldintp)
  381.                    (void) Signal(SIGPIPE, oldintp);
  382. ***************
  383. *** 947,953 ****
  384.                goto xx;
  385.            }
  386.        } else {
  387. !          if (command(cmd) == PRELIM) {
  388.                (void) Signal(SIGINT, oldintr);
  389.                if (oldintp)
  390.                    (void) Signal(SIGPIPE, oldintp);
  391. --- 947,953 ----
  392.                goto xx;
  393.            }
  394.        } else {
  395. !          if (command(cmd) != PRELIM) {
  396.                (void) Signal(SIGINT, oldintr);
  397.                if (oldintp)
  398.                    (void) Signal(SIGPIPE, oldintp);
  399. ***************
  400. *** 1136,1142 ****
  401.   
  402.   int SetToAsciiForLS(int is_retr, int currenttype)
  403.   {
  404. !     int oldt = 0, oldv;
  405.   
  406.       if (!is_retr) {
  407.           if (currenttype != TYPE_A) {
  408. --- 1136,1142 ----
  409.   
  410.   int SetToAsciiForLS(int is_retr, int currenttype)
  411.   {
  412. !     int oldt = -1, oldv;
  413.   
  414.       if (!is_retr) {
  415.           if (currenttype != TYPE_A) {
  416. ***************
  417. *** 1383,1394 ****
  418.   {
  419.       int oldv;
  420.   
  421. !     if (oldtype) {
  422.           oldv = verbose;
  423.           if (!debug)
  424.               verbose = V_QUIET;
  425. !         if (oldtype == TYPE_I)
  426. !             (void) setbinary(0, NULL);
  427.           verbose = oldv;
  428.       }
  429.   }    /* ResetOldType */
  430. --- 1383,1393 ----
  431.   {
  432.       int oldv;
  433.   
  434. !     if (oldtype >= 0) {
  435.           oldv = verbose;
  436.           if (!debug)
  437.               verbose = V_QUIET;
  438. !         (void) SetTypeByNumber(oldtype);
  439.           verbose = oldv;
  440.       }
  441.   }    /* ResetOldType */
  442. ***************
  443. *** 1500,1506 ****
  444.       }    
  445.       CloseData();
  446.       (void) getreply(0);
  447. -     ResetOldType(oldtype);
  448.   
  449.       goto xx;
  450.   
  451. --- 1499,1504 ----
  452. ***************
  453. *** 1510,1516 ****
  454.   
  455.       (void) Signal(SIGPIPE, SIG_IGN);    /* Don't bug us while aborting. */
  456.       (void) Signal(SIGINT, SIG_IGN);
  457. -     ResetOldType(oldtype);
  458.       if (!cpend || !cout) goto xx;
  459.       (void) fprintf(cout,"%c%c",IAC,IP);
  460.       (void) fflush(cout); 
  461. --- 1508,1513 ----
  462. ***************
  463. *** 1554,1559 ****
  464. --- 1551,1557 ----
  465.       if (oldintp)
  466.           (void) Signal(SIGPIPE, oldintp);
  467.       dbprintf("recvrequest result = %d.\n", result);
  468. +     ResetOldType(oldtype);
  469.       return (result);
  470.   }    /* recvrequest */
  471.   
  472. diff -c ./ftprc.c ../ncftp156/ftprc.c
  473. *** ./ftprc.c    Thu Sep 16 20:21:24 1993
  474. --- ../ncftp156/ftprc.c    Mon Sep 20 00:03:49 1993
  475. ***************
  476. *** 133,139 ****
  477.               }
  478.               ++nSites;
  479.           } else {
  480. !             free(s);
  481.           }
  482.       }
  483.   }    /* AddNewSitePtr */
  484. --- 133,139 ----
  485.               }
  486.               ++nSites;
  487.           } else {
  488. !             Free(s);
  489.           }
  490.       }
  491.   }    /* AddNewSitePtr */
  492. diff -c ./glob.c ../ncftp156/glob.c
  493. *** ./glob.c    Thu Sep 16 20:21:25 1993
  494. --- ../ncftp156/glob.c    Mon Sep 20 00:03:49 1993
  495. ***************
  496. *** 7,12 ****
  497. --- 7,13 ----
  498.   
  499.   #include "sys.h"
  500.   #include <sys/param.h>
  501. + #include <sys/types.h>
  502.   #include <sys/stat.h>
  503.   
  504.   /* Dir.h.  Try <sys/dir.h> (add -DSYSDIRH) if <dirent.h> doesn't exist. */
  505. diff -c ./main.c ../ncftp156/main.c
  506. *** ./main.c    Thu Sep 16 20:21:26 1993
  507. --- ../ncftp156/main.c    Mon Sep 20 00:03:49 1993
  508. ***************
  509. *** 7,13 ****
  510.   
  511.   #define _main_c_
  512.   
  513. ! #define FTP_VERSION "1.5.5 (September 16, 1993)"
  514.   
  515.   /* #define BETA 1 */ /* If defined, it prints a little warning message. */
  516.   
  517. --- 7,13 ----
  518.   
  519.   #define _main_c_
  520.   
  521. ! #define FTP_VERSION "1.5.6 (September 20, 1993)"
  522.   
  523.   /* #define BETA 1 */ /* If defined, it prints a little warning message. */
  524.   
  525. ***************
  526. *** 655,660 ****
  527. --- 655,661 ----
  528.       } else 
  529.           (void) strcpy(prompt2, prompt);
  530.       
  531. + #ifndef NO_STRFTIME
  532.       if (percent_flags) {
  533.           /*    only strftime if the user requested it (with a %something),
  534.               otherwise don't waste time doing nothing. */
  535. ***************
  536. *** 662,667 ****
  537. --- 663,669 ----
  538.           (void) Strncpy(str, prompt2);
  539.           (void) strftime(prompt2, sizeof(str), str, localtime(&tyme));
  540.       }
  541. + #endif
  542.       epromptlen = (size_t) ((long) strlen(lastlinestart) - (long) epromptlen);
  543.       return (prompt2);
  544.   }    /* strprompt */
  545. ***************
  546. *** 876,882 ****
  547.               }
  548.               (void) printf("\n");
  549.           }
  550. !         free(cmdnames);
  551.       } else if (helpall) {
  552.           /* Really intended to debug the help strings. */
  553.           for (c = cmdtab; c->c_name != NULL; c++) {
  554. --- 878,884 ----
  555.               }
  556.               (void) printf("\n");
  557.           }
  558. !         Free(cmdnames);
  559.       } else if (helpall) {
  560.           /* Really intended to debug the help strings. */
  561.           for (c = cmdtab; c->c_name != NULL; c++) {
  562. diff -c ./open.c ../ncftp156/open.c
  563. *** ./open.c    Thu Sep 16 20:21:26 1993
  564. --- ../ncftp156/open.c    Mon Sep 20 00:03:49 1993
  565. ***************
  566. *** 288,296 ****
  567.   
  568.   #ifdef GATEWAY
  569.       /* Try connecting to the gateway host. */
  570. !     if (*gateway)
  571.           hErr = hookup(gateway, openopt->port);
  572. !     else
  573.   #endif
  574.           hErr = hookup(openopt->hostname, openopt->port);
  575.       
  576. --- 288,297 ----
  577.   
  578.   #ifdef GATEWAY
  579.       /* Try connecting to the gateway host. */
  580. !     if (*gateway) {
  581.           hErr = hookup(gateway, openopt->port);
  582. !         (void) Strncpy(hostname, openopt->hostname);
  583. !     } else
  584.   #endif
  585.           hErr = hookup(openopt->hostname, openopt->port);
  586.       
  587. diff -c ./patchlevel.h ../ncftp156/patchlevel.h
  588. *** ./patchlevel.h    Thu Sep 16 20:21:31 1993
  589. --- ../ncftp156/patchlevel.h    Mon Sep 20 00:03:49 1993
  590. ***************
  591. *** 147,150 ****
  592. --- 147,162 ----
  593.    *
  594.    * v1.5.5 - September 16, 1993.
  595.    *  Fixed a bug where a key function wasn't returning it's results.
  596. +  *
  597. +  * v1.5.6 - September 20, 1993.
  598. +  *  Fixed bug in put, caused by "indent."  Checking for '.gz' extension
  599. +  *  for gzip in addition to '.z'.  A little better at preserving the
  600. +  *  transfer type.  Changed a syslog() call to use than 6 arguments,
  601. +  *  and reporting the full remote path to the system log now.  Have to
  602. +  *  explicitly define GZCAT in order to try paging gzip files now.
  603. +  *  Setting the current hostname correctly if using the gateway code.
  604. +  *  A lot of hacks added for SCO Xenix support: 1.  Can add -DNO_STRSTR
  605. +  *  to use own strstr();  2.  Can add -DNO_STRFTIME to make % flags in the
  606. +  *  prompt optional;  3. Can add -DNO_RENAME if you do not have rename(),
  607. +  *  or rename() doesn't work;  4. Added PTRTYPE if void ptrs are a problem.
  608.    */
  609. diff -c ./sys.h ../ncftp156/sys.h
  610. *** ./sys.h    Thu Sep 16 20:21:31 1993
  611. --- ../ncftp156/sys.h    Mon Sep 20 00:03:49 1993
  612. ***************
  613. *** 75,87 ****
  614.   #    define SYSSELECTH 1
  615.   #endif    /* _AIX */
  616.   
  617.   #ifdef SCO322
  618.   #    define BOTCHED_FOPEN_RW
  619. ! #    define SCO324
  620. ! #endif
  621.   
  622.   #ifdef SCO324
  623. ! #    define System "SCO Unix"
  624.   #    ifndef SYSV
  625.   #        define SYSV 1
  626.   #    endif
  627. --- 75,101 ----
  628.   #    define SYSSELECTH 1
  629.   #endif    /* _AIX */
  630.   
  631. + #ifdef SCOXNX
  632. + #    define System "SCO Xenix"
  633. + #    define LAI_TCP
  634. + #    define NO_UTIMEH
  635. + #    define NO_MKTIME
  636. + #    define NO_STRFTIME
  637. + #    define NO_STRSTR
  638. + #    define NO_RENAME
  639. + #    define SYSV 1
  640. + #endif    /* SCOXNX */
  641.   #ifdef SCO322
  642. + #    define System "SCO Unix 3.2v2"
  643.   #    define BOTCHED_FOPEN_RW
  644. ! #    define NO_RENAME    /* it exists, but it corrupts filesystems */
  645. ! #    define BROKEN_MEMCPY 1
  646. ! #    define SYSV 1
  647. ! #endif    /* SCO322 */
  648.   
  649.   #ifdef SCO324
  650. ! #    define System "SCO Unix 3.2v4"
  651.   #    ifndef SYSV
  652.   #        define SYSV 1
  653.   #    endif
  654. ***************
  655. *** 88,94 ****
  656.   #    ifndef BROKEN_MEMCPY
  657.   #        define BROKEN_MEMCPY 1
  658.   #    endif
  659. ! #endif    /* SCO */
  660.   
  661.   #ifdef aux
  662.   #    define System "A/UX"
  663. --- 102,108 ----
  664.   #    ifndef BROKEN_MEMCPY
  665.   #        define BROKEN_MEMCPY 1
  666.   #    endif
  667. ! #endif    /* SCO324 */
  668.   
  669.   #ifdef aux
  670.   #    define System "A/UX"
  671. ***************
  672. *** 280,285 ****
  673. --- 294,310 ----
  674.   #endif
  675.   
  676.   /*
  677. +  * Generic pointer type, e.g. as returned by malloc().
  678. +  */
  679. + #ifndef PTRTYPE
  680. + #    define PTRTYPE void
  681. + #endif
  682. + #ifndef Free
  683. + #    define Free(a) free((PTRTYPE *)(a))
  684. + #endif
  685. + /*
  686.    * Some systems besides System V don't use rindex/index (like SunOS).
  687.    * Add -DRINDEX to your SDEFS line if you need to.
  688.    */
  689. ***************
  690. *** 336,346 ****
  691.   #ifndef NO_STDLIBH
  692.   #    include <stdlib.h>
  693.   #else
  694. ! extern void *malloc(size_t);
  695. ! extern void *calloc(size_t, size_t);
  696. ! extern void *malloc(size_t);
  697. ! extern void    free(void *);
  698. ! extern void *realloc(void *, size_t);
  699.   extern void    exit(int);
  700.   
  701.   #ifdef NO_CONST
  702. --- 361,371 ----
  703.   #ifndef NO_STDLIBH
  704.   #    include <stdlib.h>
  705.   #else
  706. ! extern PTRTYPE *malloc(size_t);
  707. ! extern PTRTYPE *calloc(size_t, size_t);
  708. ! extern PTRTYPE *malloc(size_t);
  709. ! extern void    free(PTRTYPE *);
  710. ! extern PTRTYPE *realloc(PTRTYPE *, size_t);
  711.   extern void    exit(int);
  712.   
  713.   #ifdef NO_CONST
  714. diff -c ./util.c ../ncftp156/util.c
  715. *** ./util.c    Thu Sep 16 20:21:28 1993
  716. --- ../ncftp156/util.c    Mon Sep 20 00:03:49 1993
  717. ***************
  718. *** 774,777 ****
  719. --- 774,820 ----
  720.       return cp;
  721.   }    /* LocalDotPath */
  722.   
  723. + #ifdef NO_STRSTR
  724. + /*
  725. +  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  726. +  *
  727. +  *            Copyright (c) 1988-1992 USENET Community Trust
  728. +  *            Copyright (c) 1986,1987 Dave Taylor
  729. +  */
  730. + char *strstr(s1, s2)
  731. + char *s1, *s2;
  732. + {
  733. +     int len;
  734. +     char *ptr;
  735. +     char *tmpptr;
  736. +     ptr = NULL;
  737. +     len = strlen(s2);
  738. +     if ( len <= strlen(s1)) {
  739. +         tmpptr = s1;
  740. +         while ((ptr = index(tmpptr, (int)*s2)) != NULL) {
  741. +             if (strncmp(ptr, s2, len) == 0) {
  742. +                 break;
  743. +             }
  744. +             tmpptr = ptr+1;
  745. +         }
  746. +     }
  747. +     return (ptr);
  748. + }
  749. + #endif
  750. + #ifdef NO_RENAME
  751. + int rename(oldname, newname)
  752. + const char *oldname, *newname;
  753. + {
  754. +     return (link(oldname, newname) == 0 ? unlink(oldname) : -1);
  755. + }
  756. + #endif /*NO_RENAME*/
  757.   /* eof Util.c */
  758. diff -c ./util.h ../ncftp156/util.h
  759. *** ./util.h    Thu Sep 16 20:21:31 1993
  760. --- ../ncftp156/util.h    Mon Sep 20 00:03:49 1993
  761. ***************
  762. *** 81,84 ****
  763. --- 81,88 ----
  764.   char *LocalDotPath(char *path);
  765.   char *GetHomeDir(char *home);
  766.   
  767. + #ifdef NO_STRSTR
  768. + char *strstr(char *s1, char *s2);
  769. + #endif
  770.   #endif    /* _util_h_ */
  771. --
  772. ______________________________________________________________________________
  773. mike gleason                 mgleason@cse.unl.edu             NCEMRSoft, baby!
  774.  
  775. exit 0 # Just in case...
  776.