home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume30 / perl / patch26 < prev    next >
Encoding:
Text File  |  1992-06-11  |  49.3 KB  |  1,972 lines

  1. Newsgroups: comp.sources.misc
  2. From: lwall@netlabs.com (Larry Wall)
  3. Subject:  v30i037:  perl - The perl programming language, Patch26
  4. Message-ID: <1992Jun11.180523.527@sparky.imd.sterling.com>
  5. X-Md4-Signature: 18c4bf1a1e924dd0670a7367ed2631c7
  6. Date: Thu, 11 Jun 1992 18:05:23 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lwall@netlabs.com (Larry Wall)
  10. Posting-number: Volume 30, Issue 37
  11. Archive-name: perl/patch26
  12. Environment: UNIX, MS-DOS, OS2
  13. Patch-To: perl: Volume 18, Issue 19-54
  14.  
  15. System: perl version 4.0
  16. Patch #: 26
  17. Priority: highish
  18. Subject: patch #20, continued
  19.  
  20. Description:
  21.     See patch #20.
  22.  
  23. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your perl source
  24.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  25.     If you don't have the patch program, apply the following by hand,
  26.     or get patch (version 2.0, latest patchlevel).
  27.  
  28.     After patching:
  29.         *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #33 FIRST ***
  30.  
  31.     If patch indicates that patchlevel is the wrong version, you may need
  32.     to apply one or more previous patches, or the patch may already
  33.     have been applied.  See the patchlevel.h file to find out what has or
  34.     has not been applied.  In any event, don't continue with the patch.
  35.  
  36.     If you are missing previous patches they can be obtained from me:
  37.  
  38.     Larry Wall
  39.     lwall@netlabs.com
  40.  
  41.     If you send a mail message of the following form it will greatly speed
  42.     processing:
  43.  
  44.     Subject: Command
  45.     @SH mailpatch PATH perl 4.0 LIST
  46.            ^ note the c
  47.  
  48.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  49.     or in bang notation from some well-known host, and LIST is the number
  50.     of one or more patches you need, separated by spaces, commas, and/or
  51.     hyphens.  Saying 35- says everything from 35 to the end.
  52.  
  53.  
  54. Index: patchlevel.h
  55. Prereq: 25
  56. 1c1
  57. < #define PATCHLEVEL 25
  58. ---
  59. > #define PATCHLEVEL 26
  60.  
  61. Index: doio.c
  62. *** doio.c.old    Mon Jun  8 17:46:42 1992
  63. --- doio.c    Mon Jun  8 17:46:44 1992
  64. ***************
  65. *** 1,4 ****
  66. ! /* $RCSfile: doio.c,v $$Revision: 4.0.1.4 $$Date: 91/11/05 16:51:43 $
  67.    *
  68.    *    Copyright (c) 1991, Larry Wall
  69.    *
  70. --- 1,4 ----
  71. ! /* $RCSfile: doio.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 13:00:21 $
  72.    *
  73.    *    Copyright (c) 1991, Larry Wall
  74.    *
  75. ***************
  76. *** 6,11 ****
  77. --- 6,21 ----
  78.    *    License or the Artistic License, as specified in the README file.
  79.    *
  80.    * $Log:    doio.c,v $
  81. +  * Revision 4.0.1.5  92/06/08  13:00:21  lwall
  82. +  * patch20: some machines don't define ENOTSOCK in errno.h
  83. +  * patch20: new warnings for failed use of stat operators on filenames with \n
  84. +  * patch20: wait failed when STDOUT or STDERR reopened to a pipe
  85. +  * patch20: end of file latch not reset on reopen of STDIN
  86. +  * patch20: seek(HANDLE, 0, 1) went to eof because of ancient Ultrix workaround
  87. +  * patch20: fixed memory leak on system() for vfork() machines
  88. +  * patch20: get*by* routines now return something useful in a scalar context
  89. +  * patch20: h_errno now accessible via $?
  90. +  * 
  91.    * Revision 4.0.1.4  91/11/05  16:51:43  lwall
  92.    * patch11: prepared for ctype implementations that don't define isascii()
  93.    * patch11: perl mistook some streams for sockets because they return mode 0 too
  94. ***************
  95. *** 41,47 ****
  96. --- 51,60 ----
  97.   #ifdef HAS_SOCKET
  98.   #include <sys/socket.h>
  99.   #include <netdb.h>
  100. + #ifndef ENOTSOCK
  101. + #include <net/errno.h>
  102.   #endif
  103. + #endif
  104.   
  105.   #ifdef HAS_SELECT
  106.   #ifdef I_SYS_SELECT
  107. ***************
  108. *** 83,88 ****
  109. --- 96,103 ----
  110.   int laststatval = -1;
  111.   int laststype = O_STAT;
  112.   
  113. + static char* warn_nl = "Unsuccessful %s on filename containing newline";
  114.   bool
  115.   do_open(stab,name,len)
  116.   STAB *stab;
  117. ***************
  118. *** 100,105 ****
  119. --- 115,121 ----
  120.       FILE *saveofp = Nullfp;
  121.       char savetype = ' ';
  122.   
  123. +     mode[0] = mode[1] = mode[2] = '\0';
  124.       name = myname;
  125.       forkprocess = 1;        /* assume true if no fork */
  126.       while (len && isSPACE(name[len-1]))
  127. ***************
  128. *** 130,136 ****
  129.           result = fclose(stio->ifp);
  130.       if (result == EOF && fd > maxsysfd)
  131.           fprintf(stderr,"Warning: unable to close filehandle %s properly.\n",
  132. !           stab_name(stab));
  133.       stio->ofp = stio->ifp = Nullfp;
  134.       }
  135.       if (*name == '+' && len > 1 && name[len-1] != '|') {    /* scary */
  136. --- 146,152 ----
  137.           result = fclose(stio->ifp);
  138.       if (result == EOF && fd > maxsysfd)
  139.           fprintf(stderr,"Warning: unable to close filehandle %s properly.\n",
  140. !           stab_ename(stab));
  141.       stio->ofp = stio->ifp = Nullfp;
  142.       }
  143.       if (*name == '+' && len > 1 && name[len-1] != '|') {    /* scary */
  144. ***************
  145. *** 244,252 ****
  146.           fp = fopen(name,"r");
  147.       }
  148.       }
  149. !     Safefree(myname);
  150. !     if (!fp)
  151.       goto say_false;
  152.       if (stio->type &&
  153.         stio->type != '|' && stio->type != '-') {
  154.       if (fstat(fileno(fp),&statbuf) < 0) {
  155. --- 260,272 ----
  156.           fp = fopen(name,"r");
  157.       }
  158.       }
  159. !     if (!fp) {
  160. !     if (dowarn && stio->type == '<' && index(name, '\n'))
  161. !         warn(warn_nl, "open");
  162. !     Safefree(myname);
  163.       goto say_false;
  164. +     }
  165. +     Safefree(myname);
  166.       if (stio->type &&
  167.         stio->type != '|' && stio->type != '-') {
  168.       if (fstat(fileno(fp),&statbuf) < 0) {
  169. ***************
  170. *** 263,269 ****
  171.           !statbuf.st_mode
  172.   #endif
  173.       ) {
  174. !         if (getsockname(fileno(fp), tokenbuf, 0) >= 0 || errno != ENOTSOCK)
  175.           stio->type = 's'; /* some OS's return 0 on fstat()ed socket */
  176.                   /* but some return 0 for streams too, sigh */
  177.       }
  178. --- 283,291 ----
  179.           !statbuf.st_mode
  180.   #endif
  181.       ) {
  182. !         int buflen = sizeof tokenbuf;
  183. !         if (getsockname(fileno(fp), tokenbuf, &buflen) >= 0
  184. !         || errno != ENOTSOCK)
  185.           stio->type = 's'; /* some OS's return 0 on fstat()ed socket */
  186.                   /* but some return 0 for streams too, sigh */
  187.       }
  188. ***************
  189. *** 280,289 ****
  190. --- 302,321 ----
  191.           }
  192.       }
  193.       if (fd != fileno(fp)) {
  194. +         int pid;
  195. +         STR *str;
  196.           dup2(fileno(fp), fd);
  197. +         str = afetch(fdpid,fileno(fp),TRUE);
  198. +         pid = str->str_u.str_useful;
  199. +         str->str_u.str_useful = 0;
  200. +         str = afetch(fdpid,fd,TRUE);
  201. +         str->str_u.str_useful = pid;
  202.           fclose(fp);
  203.       }
  204.       fp = saveifp;
  205. +     clearerr(fp);
  206.       }
  207.   #if defined(HAS_FCNTL) && defined(F_SETFD)
  208.       fd = fileno(fp);
  209. ***************
  210. *** 384,390 ****
  211.               }
  212.   #endif
  213.   #ifdef HAS_RENAME
  214. ! #ifndef MSDOS
  215.               if (rename(oldname,str->str_ptr) < 0) {
  216.               warn("Can't rename %s to %s: %s, skipping file",
  217.                 oldname, str->str_ptr, strerror(errno) );
  218. --- 416,422 ----
  219.               }
  220.   #endif
  221.   #ifdef HAS_RENAME
  222. ! #ifndef DOSISH
  223.               if (rename(oldname,str->str_ptr) < 0) {
  224.               warn("Can't rename %s to %s: %s, skipping file",
  225.                 oldname, str->str_ptr, strerror(errno) );
  226. ***************
  227. *** 411,417 ****
  228.   #endif
  229.           }
  230.           else {
  231. ! #ifndef MSDOS
  232.               if (UNLINK(oldname) < 0) {
  233.               warn("Can't rename %s to %s: %s, skipping file",
  234.                 oldname, str->str_ptr, strerror(errno) );
  235. --- 443,449 ----
  236.   #endif
  237.           }
  238.           else {
  239. ! #ifndef DOSISH
  240.               if (UNLINK(oldname) < 0) {
  241.               warn("Can't rename %s to %s: %s, skipping file",
  242.                 oldname, str->str_ptr, strerror(errno) );
  243. ***************
  244. *** 536,542 ****
  245.       stio = stab_io(stab);
  246.       if (!stio) {        /* never opened */
  247.       if (dowarn && explicit)
  248. !         warn("Close on unopened file <%s>",stab_name(stab));
  249.       return FALSE;
  250.       }
  251.       if (stio->ifp) {
  252. --- 568,574 ----
  253.       stio = stab_io(stab);
  254.       if (!stio) {        /* never opened */
  255.       if (dowarn && explicit)
  256. !         warn("Close on unopened file <%s>",stab_ename(stab));
  257.       return FALSE;
  258.       }
  259.       if (stio->ifp) {
  260. ***************
  261. *** 621,628 ****
  262. --- 653,662 ----
  263.       if (!stio || !stio->ifp)
  264.       goto phooey;
  265.   
  266. + #ifdef ULTRIX_STDIO_BOTCH
  267.       if (feof(stio->ifp))
  268.       (void)fseek (stio->ifp, 0L, 2);        /* ultrix 1.2 workaround */
  269. + #endif
  270.   
  271.       return ftell(stio->ifp);
  272.   
  273. ***************
  274. *** 648,655 ****
  275. --- 682,691 ----
  276.       if (!stio || !stio->ifp)
  277.       goto nuts;
  278.   
  279. + #ifdef ULTRIX_STDIO_BOTCH
  280.       if (feof(stio->ifp))
  281.       (void)fseek (stio->ifp, 0L, 2);        /* ultrix 1.2 workaround */
  282. + #endif
  283.   
  284.       return fseek(stio->ifp, pos, whence) >= 0;
  285.   
  286. ***************
  287. *** 700,706 ****
  288.       }
  289.       else {
  290.       retval = (int)str_gnum(argstr);
  291. ! #ifdef MSDOS
  292.       s = (char*)(long)retval;        /* ouch */
  293.   #else
  294.       s = (char*)retval;        /* ouch */
  295. --- 736,742 ----
  296.       }
  297.       else {
  298.       retval = (int)str_gnum(argstr);
  299. ! #ifdef DOSISH
  300.       s = (char*)(long)retval;        /* ouch */
  301.   #else
  302.       s = (char*)retval;        /* ouch */
  303. ***************
  304. *** 711,717 ****
  305.       if (optype == O_IOCTL)
  306.       retval = ioctl(fileno(stio->ifp), func, s);
  307.       else
  308. ! #ifdef MSDOS
  309.       fatal("fcntl is not implemented");
  310.   #else
  311.   #ifdef HAS_FCNTL
  312. --- 747,753 ----
  313.       if (optype == O_IOCTL)
  314.       retval = ioctl(fileno(stio->ifp), func, s);
  315.       else
  316. ! #ifdef DOSISH
  317.       fatal("fcntl is not implemented");
  318.   #else
  319.   #ifdef HAS_FCNTL
  320. ***************
  321. *** 768,775 ****
  322.       else
  323.   #endif
  324.           laststatval = stat(str_get(statname),&statcache);
  325. !     if (laststatval < 0)
  326.           max = 0;
  327.       }
  328.   
  329.       if (gimme != G_ARRAY) {
  330. --- 804,814 ----
  331.       else
  332.   #endif
  333.           laststatval = stat(str_get(statname),&statcache);
  334. !     if (laststatval < 0) {
  335. !         if (dowarn && index(str_get(statname), '\n'))
  336. !         warn(warn_nl, "stat");
  337.           max = 0;
  338. +     }
  339.       }
  340.   
  341.       if (gimme != G_ARRAY) {
  342. ***************
  343. *** 1000,1006 ****
  344.       if (*tmps == 'S' && tmps[1] == 't' && tmps[2] == 'B' && tmps[3] == '\0'
  345.         && str->str_cur == sizeof(STBP) && strlen(tmps) < str->str_cur) {
  346.           STR *tmpstr = str_mortal(&str_undef);
  347. !         stab_fullname(tmpstr,((STAB*)str));/* a stab value, be nice */
  348.           str = tmpstr;
  349.           tmps = str->str_ptr;
  350.           putc('*',fp);
  351. --- 1039,1045 ----
  352.       if (*tmps == 'S' && tmps[1] == 't' && tmps[2] == 'B' && tmps[3] == '\0'
  353.         && str->str_cur == sizeof(STBP) && strlen(tmps) < str->str_cur) {
  354.           STR *tmpstr = str_mortal(&str_undef);
  355. !         stab_efullname(tmpstr,((STAB*)str));/* a stab value, be nice */
  356.           str = tmpstr;
  357.           tmps = str->str_ptr;
  358.           putc('*',fp);
  359. ***************
  360. *** 1072,1078 ****
  361.           return laststatval;
  362.           if (dowarn)
  363.           warn("Stat on unopened file <%s>",
  364. !           stab_name(arg[1].arg_ptr.arg_stab));
  365.           statstab = Nullstab;
  366.           str_set(statname,"");
  367.           return (laststatval = -1);
  368. --- 1111,1117 ----
  369.           return laststatval;
  370.           if (dowarn)
  371.           warn("Stat on unopened file <%s>",
  372. !           stab_ename(arg[1].arg_ptr.arg_stab));
  373.           statstab = Nullstab;
  374.           str_set(statname,"");
  375.           return (laststatval = -1);
  376. ***************
  377. *** 1082,1088 ****
  378.       statstab = Nullstab;
  379.       str_set(statname,str_get(str));
  380.       laststype = O_STAT;
  381. !     return (laststatval = stat(str_get(str),&statcache));
  382.       }
  383.   }
  384.   
  385. --- 1121,1130 ----
  386.       statstab = Nullstab;
  387.       str_set(statname,str_get(str));
  388.       laststype = O_STAT;
  389. !     laststatval = stat(str_get(str),&statcache);
  390. !     if (laststatval < 0 && dowarn && index(str_get(str), '\n'))
  391. !         warn(warn_nl, "stat");
  392. !     return laststatval;
  393.       }
  394.   }
  395.   
  396. ***************
  397. *** 1104,1113 ****
  398.       statstab = Nullstab;
  399.       str_set(statname,str_get(str));
  400.   #ifdef HAS_LSTAT
  401. !     return (laststatval = lstat(str_get(str),&statcache));
  402.   #else
  403. !     return (laststatval = stat(str_get(str),&statcache));
  404.   #endif
  405.   }
  406.   
  407.   STR *
  408. --- 1146,1158 ----
  409.       statstab = Nullstab;
  410.       str_set(statname,str_get(str));
  411.   #ifdef HAS_LSTAT
  412. !     laststatval = lstat(str_get(str),&statcache);
  413.   #else
  414. !     laststatval = stat(str_get(str),&statcache);
  415.   #endif
  416. +     if (laststatval < 0 && dowarn && index(str_get(str), '\n'))
  417. +     warn(warn_nl, "lstat");
  418. +     return laststatval;
  419.   }
  420.   
  421.   STR *
  422. ***************
  423. *** 1137,1143 ****
  424.           stio = stab_io(statstab);
  425.       }
  426.       if (stio && stio->ifp) {
  427. ! #ifdef STDSTDIO
  428.           fstat(fileno(stio->ifp),&statcache);
  429.           if (S_ISDIR(statcache.st_mode))    /* handle NFS glitch */
  430.           return arg->arg_type == O_FTTEXT ? &str_no : &str_yes;
  431. --- 1182,1188 ----
  432.           stio = stab_io(statstab);
  433.       }
  434.       if (stio && stio->ifp) {
  435. ! #if defined(STDSTDIO) || defined(atarist) /* this will work with atariST */
  436.           fstat(fileno(stio->ifp),&statcache);
  437.           if (S_ISDIR(statcache.st_mode))    /* handle NFS glitch */
  438.           return arg->arg_type == O_FTTEXT ? &str_no : &str_yes;
  439. ***************
  440. *** 1157,1163 ****
  441.       else {
  442.           if (dowarn)
  443.           warn("Test on unopened file <%s>",
  444. !           stab_name(arg[1].arg_ptr.arg_stab));
  445.           errno = EBADF;
  446.           return &str_undef;
  447.       }
  448. --- 1202,1208 ----
  449.       else {
  450.           if (dowarn)
  451.           warn("Test on unopened file <%s>",
  452. !           stab_ename(arg[1].arg_ptr.arg_stab));
  453.           errno = EBADF;
  454.           return &str_undef;
  455.       }
  456. ***************
  457. *** 1167,1174 ****
  458.       str_set(statname,str_get(str));
  459.         really_filename:
  460.       i = open(str_get(str),0);
  461. !     if (i < 0)
  462.           return &str_undef;
  463.       fstat(i,&statcache);
  464.       len = read(i,tbuf,512);
  465.       (void)close(i);
  466. --- 1212,1222 ----
  467.       str_set(statname,str_get(str));
  468.         really_filename:
  469.       i = open(str_get(str),0);
  470. !     if (i < 0) {
  471. !         if (dowarn && index(str_get(str), '\n'))
  472. !         warn(warn_nl, "open");
  473.           return &str_undef;
  474. +     }
  475.       fstat(i,&statcache);
  476.       len = read(i,tbuf,512);
  477.       (void)close(i);
  478. ***************
  479. *** 1201,1206 ****
  480. --- 1249,1257 ----
  481.       return &str_yes;
  482.   }
  483.   
  484. + static char **Argv = Null(char **);
  485. + static char *Cmd = Nullch;
  486.   bool
  487.   do_aexec(really,arglast)
  488.   STR *really;
  489. ***************
  490. *** 1210,1221 ****
  491.       register int sp = arglast[1];
  492.       register int items = arglast[2] - sp;
  493.       register char **a;
  494. -     char **argv;
  495.       char *tmps;
  496.   
  497.       if (items) {
  498. !     New(401,argv, items+1, char*);
  499. !     a = argv;
  500.       for (st += ++sp; items > 0; items--,st++) {
  501.           if (*st)
  502.           *a++ = str_get(*st);
  503. --- 1261,1271 ----
  504.       register int sp = arglast[1];
  505.       register int items = arglast[2] - sp;
  506.       register char **a;
  507.       char *tmps;
  508.   
  509.       if (items) {
  510. !     New(401,Argv, items+1, char*);
  511. !     a = Argv;
  512.       for (st += ++sp; items > 0; items--,st++) {
  513.           if (*st)
  514.           *a++ = str_get(*st);
  515. ***************
  516. *** 1224,1244 ****
  517.       }
  518.       *a = Nullch;
  519.   #ifdef TAINT
  520. !     if (*argv[0] != '/')    /* will execvp use PATH? */
  521.           taintenv();        /* testing IFS here is overkill, probably */
  522.   #endif
  523.       if (really && *(tmps = str_get(really)))
  524. !         execvp(tmps,argv);
  525.       else
  526. !         execvp(argv[0],argv);
  527. !     Safefree(argv);
  528.       }
  529.       return FALSE;
  530.   }
  531.   
  532. - static char **Argv = Null(char **);
  533. - static char *Cmd = Nullch;
  534.   void
  535.   do_execfree()
  536.   {
  537. --- 1274,1291 ----
  538.       }
  539.       *a = Nullch;
  540.   #ifdef TAINT
  541. !     if (*Argv[0] != '/')    /* will execvp use PATH? */
  542.           taintenv();        /* testing IFS here is overkill, probably */
  543.   #endif
  544.       if (really && *(tmps = str_get(really)))
  545. !         execvp(tmps,Argv);
  546.       else
  547. !         execvp(Argv[0],Argv);
  548.       }
  549. +     do_execfree();
  550.       return FALSE;
  551.   }
  552.   
  553.   void
  554.   do_execfree()
  555.   {
  556. ***************
  557. *** 1551,1558 ****
  558.       register int sp = arglast[1];
  559.       register STIO *stio;
  560.       int fd;
  561. !     int lvl;
  562. !     int optname;
  563.   
  564.       if (!stab)
  565.       goto nuts;
  566. --- 1598,1605 ----
  567.       register int sp = arglast[1];
  568.       register STIO *stio;
  569.       int fd;
  570. !     unsigned int lvl;
  571. !     unsigned int optname;
  572.   
  573.       if (!stab)
  574.       goto nuts;
  575. ***************
  576. *** 1562,1575 ****
  577.       goto nuts;
  578.   
  579.       fd = fileno(stio->ifp);
  580. !     lvl = (int)str_gnum(st[sp+1]);
  581. !     optname = (int)str_gnum(st[sp+2]);
  582.       switch (optype) {
  583.       case O_GSOCKOPT:
  584.       st[sp] = str_2mortal(Str_new(22,257));
  585.       st[sp]->str_cur = 256;
  586.       st[sp]->str_pok = 1;
  587. !     if (getsockopt(fd, lvl, optname, st[sp]->str_ptr, &st[sp]->str_cur) < 0)
  588.           goto nuts;
  589.       break;
  590.       case O_SSOCKOPT:
  591. --- 1609,1623 ----
  592.       goto nuts;
  593.   
  594.       fd = fileno(stio->ifp);
  595. !     lvl = (unsigned int)str_gnum(st[sp+1]);
  596. !     optname = (unsigned int)str_gnum(st[sp+2]);
  597.       switch (optype) {
  598.       case O_GSOCKOPT:
  599.       st[sp] = str_2mortal(Str_new(22,257));
  600.       st[sp]->str_cur = 256;
  601.       st[sp]->str_pok = 1;
  602. !     if (getsockopt(fd, lvl, optname, st[sp]->str_ptr,
  603. !             (int*)&st[sp]->str_cur) < 0)
  604.           goto nuts;
  605.       break;
  606.       case O_SSOCKOPT:
  607. ***************
  608. *** 1615,1625 ****
  609.       fd = fileno(stio->ifp);
  610.       switch (optype) {
  611.       case O_GETSOCKNAME:
  612. !     if (getsockname(fd, st[sp]->str_ptr, &st[sp]->str_cur) < 0)
  613.           goto nuts2;
  614.       break;
  615.       case O_GETPEERNAME:
  616. !     if (getpeername(fd, st[sp]->str_ptr, &st[sp]->str_cur) < 0)
  617.           goto nuts2;
  618.       break;
  619.       }
  620. --- 1663,1673 ----
  621.       fd = fileno(stio->ifp);
  622.       switch (optype) {
  623.       case O_GETSOCKNAME:
  624. !     if (getsockname(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
  625.           goto nuts2;
  626.       break;
  627.       case O_GETPEERNAME:
  628. !     if (getpeername(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
  629.           goto nuts2;
  630.       break;
  631.       }
  632. ***************
  633. *** 1654,1664 ****
  634.       struct hostent *hent;
  635.       unsigned long len;
  636.   
  637. -     if (gimme != G_ARRAY) {
  638. -     astore(ary, ++sp, str_mortal(&str_undef));
  639. -     return sp;
  640. -     }
  641.       if (which == O_GHBYNAME) {
  642.       char *name = str_get(ary->ary_array[sp+1]);
  643.   
  644. --- 1702,1707 ----
  645. ***************
  646. *** 1677,1682 ****
  647. --- 1720,1747 ----
  648.   #else
  649.       fatal("gethostent not implemented");
  650.   #endif
  651. + #ifdef HOST_NOT_FOUND
  652. +     if (!hent)
  653. +     statusvalue = (unsigned short)h_errno & 0xffff;
  654. + #endif
  655. +     if (gimme != G_ARRAY) {
  656. +     astore(ary, ++sp, str = str_mortal(&str_undef));
  657. +     if (hent) {
  658. +         if (which == O_GHBYNAME) {
  659. + #ifdef h_addr
  660. +         str_nset(str, *hent->h_addr, hent->h_length);
  661. + #else
  662. +         str_nset(str, hent->h_addr, hent->h_length);
  663. + #endif
  664. +         }
  665. +         else
  666. +         str_set(str, hent->h_name);
  667. +     }
  668. +     return sp;
  669. +     }
  670.       if (hent) {
  671.   #ifndef lint
  672.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  673. ***************
  674. *** 1726,1736 ****
  675.       struct netent *getnetent();
  676.       struct netent *nent;
  677.   
  678. -     if (gimme != G_ARRAY) {
  679. -     astore(ary, ++sp, str_mortal(&str_undef));
  680. -     return sp;
  681. -     }
  682.       if (which == O_GNBYNAME) {
  683.       char *name = str_get(ary->ary_array[sp+1]);
  684.   
  685. --- 1791,1796 ----
  686. ***************
  687. *** 1745,1750 ****
  688. --- 1805,1821 ----
  689.       else
  690.       nent = getnetent();
  691.   
  692. +     if (gimme != G_ARRAY) {
  693. +     astore(ary, ++sp, str = str_mortal(&str_undef));
  694. +     if (nent) {
  695. +         if (which == O_GNBYNAME)
  696. +         str_numset(str, (double)nent->n_net);
  697. +         else
  698. +         str_set(str, nent->n_name);
  699. +     }
  700. +     return sp;
  701. +     }
  702.       if (nent) {
  703.   #ifndef lint
  704.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  705. ***************
  706. *** 1784,1794 ****
  707.       struct protoent *getprotoent();
  708.       struct protoent *pent;
  709.   
  710. -     if (gimme != G_ARRAY) {
  711. -     astore(ary, ++sp, str_mortal(&str_undef));
  712. -     return sp;
  713. -     }
  714.       if (which == O_GPBYNAME) {
  715.       char *name = str_get(ary->ary_array[sp+1]);
  716.   
  717. --- 1855,1860 ----
  718. ***************
  719. *** 1802,1807 ****
  720. --- 1868,1884 ----
  721.       else
  722.       pent = getprotoent();
  723.   
  724. +     if (gimme != G_ARRAY) {
  725. +     astore(ary, ++sp, str = str_mortal(&str_undef));
  726. +     if (pent) {
  727. +         if (which == O_GPBYNAME)
  728. +         str_numset(str, (double)pent->p_proto);
  729. +         else
  730. +         str_set(str, pent->p_name);
  731. +     }
  732. +     return sp;
  733. +     }
  734.       if (pent) {
  735.   #ifndef lint
  736.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  737. ***************
  738. *** 1839,1849 ****
  739.       struct servent *getservent();
  740.       struct servent *sent;
  741.   
  742. -     if (gimme != G_ARRAY) {
  743. -     astore(ary, ++sp, str_mortal(&str_undef));
  744. -     return sp;
  745. -     }
  746.       if (which == O_GSBYNAME) {
  747.       char *name = str_get(ary->ary_array[sp+1]);
  748.       char *proto = str_get(ary->ary_array[sp+2]);
  749. --- 1916,1921 ----
  750. ***************
  751. *** 1861,1866 ****
  752. --- 1933,1955 ----
  753.       }
  754.       else
  755.       sent = getservent();
  756. +     if (gimme != G_ARRAY) {
  757. +     astore(ary, ++sp, str = str_mortal(&str_undef));
  758. +     if (sent) {
  759. +         if (which == O_GSBYNAME) {
  760. + #ifdef HAS_NTOHS
  761. +         str_numset(str, (double)ntohs(sent->s_port));
  762. + #else
  763. +         str_numset(str, (double)(sent->s_port));
  764. + #endif
  765. +         }
  766. +         else
  767. +         str_set(str, sent->s_name);
  768. +     }
  769. +     return sp;
  770. +     }
  771.       if (sent) {
  772.   #ifndef lint
  773.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  774. ***************
  775. *** 2007,2012 ****
  776. --- 2096,2102 ----
  777.           for (j = 0, k=ORDERBYTE; j < masksize; j++, (k >>= 4))
  778.               s[(k % masksize) + offset] = fd_sets[i][j+offset];
  779.           }
  780. +         Safefree(fd_sets[i]);
  781.       }
  782.       }
  783.   #endif
  784. ***************
  785. *** 2098,2108 ****
  786.       struct passwd *getpwent();
  787.       struct passwd *pwent;
  788.   
  789. -     if (gimme != G_ARRAY) {
  790. -     astore(ary, ++sp, str_mortal(&str_undef));
  791. -     return sp;
  792. -     }
  793.       if (which == O_GPWNAM) {
  794.       char *name = str_get(ary->ary_array[sp+1]);
  795.   
  796. --- 2188,2193 ----
  797. ***************
  798. *** 2116,2121 ****
  799. --- 2201,2217 ----
  800.       else
  801.       pwent = getpwent();
  802.   
  803. +     if (gimme != G_ARRAY) {
  804. +     astore(ary, ++sp, str = str_mortal(&str_undef));
  805. +     if (pwent) {
  806. +         if (which == O_GPWNAM)
  807. +         str_numset(str, (double)pwent->pw_uid);
  808. +         else
  809. +         str_set(str, pwent->pw_name);
  810. +     }
  811. +     return sp;
  812. +     }
  813.       if (pwent) {
  814.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  815.       str_set(str, pwent->pw_name);
  816. ***************
  817. *** 2179,2189 ****
  818.       struct group *getgrent();
  819.       struct group *grent;
  820.   
  821. -     if (gimme != G_ARRAY) {
  822. -     astore(ary, ++sp, str_mortal(&str_undef));
  823. -     return sp;
  824. -     }
  825.       if (which == O_GGRNAM) {
  826.       char *name = str_get(ary->ary_array[sp+1]);
  827.   
  828. --- 2275,2280 ----
  829. ***************
  830. *** 2197,2202 ****
  831. --- 2288,2304 ----
  832.       else
  833.       grent = getgrent();
  834.   
  835. +     if (gimme != G_ARRAY) {
  836. +     astore(ary, ++sp, str = str_mortal(&str_undef));
  837. +     if (grent) {
  838. +         if (which == O_GGRNAM)
  839. +         str_numset(str, (double)grent->gr_gid);
  840. +         else
  841. +         str_set(str, grent->gr_name);
  842. +     }
  843. +     return sp;
  844. +     }
  845.       if (grent) {
  846.       (void)astore(ary, ++sp, str = str_mortal(&str_no));
  847.       str_set(str, grent->gr_name);
  848. ***************
  849. *** 2231,2239 ****
  850.       register int sp = arglast[1];
  851.       register STIO *stio;
  852.       long along;
  853. - #ifndef telldir
  854. -     long telldir();
  855. - #endif
  856.   #ifndef apollo
  857.       struct DIRENT *readdir();
  858.   #endif
  859. --- 2333,2338 ----
  860. ***************
  861. *** 2278,2307 ****
  862.   #endif
  863.       }
  864.       break;
  865. ! #if MACH
  866. !     case O_TELLDIR:
  867.       case O_SEEKDIR:
  868. -         goto nope;
  869. - #else
  870. -     case O_TELLDIR:
  871.       st[sp] = str_mortal(&str_undef);
  872. -     str_numset(st[sp], (double)telldir(stio->dirp));
  873. -     break;
  874. -     case O_SEEKDIR:
  875. -     st[sp] = str_mortal(&str_undef);
  876.       along = (long)str_gnum(st[sp+1]);
  877.       (void)seekdir(stio->dirp,along);
  878.       break;
  879.   #endif
  880.       case O_REWINDDIR:
  881.       st[sp] = str_mortal(&str_undef);
  882.       (void)rewinddir(stio->dirp);
  883.       break;
  884.       case O_CLOSEDIR:
  885.       st[sp] = str_mortal(&str_undef);
  886.       (void)closedir(stio->dirp);
  887.       stio->dirp = 0;
  888.       break;
  889.       }
  890.       return sp;
  891.   
  892. --- 2377,2412 ----
  893.   #endif
  894.       }
  895.       break;
  896. ! #if defined(HAS_TELLDIR) || defined(telldir)
  897. !     case O_TELLDIR: {
  898. ! #ifndef telldir
  899. !         long telldir();
  900. ! #endif
  901. !         st[sp] = str_mortal(&str_undef);
  902. !         str_numset(st[sp], (double)telldir(stio->dirp));
  903. !         break;
  904. !     }
  905. ! #endif
  906. ! #if defined(HAS_SEEKDIR) || defined(seekdir)
  907.       case O_SEEKDIR:
  908.       st[sp] = str_mortal(&str_undef);
  909.       along = (long)str_gnum(st[sp+1]);
  910.       (void)seekdir(stio->dirp,along);
  911.       break;
  912.   #endif
  913. + #if defined(HAS_REWINDDIR) || defined(rewinddir)
  914.       case O_REWINDDIR:
  915.       st[sp] = str_mortal(&str_undef);
  916.       (void)rewinddir(stio->dirp);
  917.       break;
  918. + #endif
  919.       case O_CLOSEDIR:
  920.       st[sp] = str_mortal(&str_undef);
  921.       (void)closedir(stio->dirp);
  922.       stio->dirp = 0;
  923.       break;
  924. +     default:
  925. +     goto phooey;
  926.       }
  927.       return sp;
  928.   
  929. ***************
  930. *** 2311,2321 ****
  931.       errno = EBADF;
  932.       return sp;
  933.   
  934. - #else
  935. -     fatal("Unimplemented directory operation");
  936.   #endif
  937.   }
  938.   
  939.   apply(type,arglast)
  940.   int type;
  941.   int *arglast;
  942. --- 2416,2427 ----
  943.       errno = EBADF;
  944.       return sp;
  945.   
  946.   #endif
  947. + phooey:
  948. +     fatal("Unimplemented directory operation");
  949.   }
  950.   
  951. + int
  952.   apply(type,arglast)
  953.   int type;
  954.   int *arglast;
  955. ***************
  956. *** 2469,2475 ****
  957.   int effective;
  958.   register struct stat *statbufp;
  959.   {
  960. ! #ifdef MSDOS
  961.       /* [Comments and code from Len Reed]
  962.        * MS-DOS "user" is similar to UNIX's "superuser," but can't write
  963.        * to write-protected files.  The execute permission bit is set
  964. --- 2575,2581 ----
  965.   int effective;
  966.   register struct stat *statbufp;
  967.   {
  968. ! #ifdef DOSISH
  969.       /* [Comments and code from Len Reed]
  970.        * MS-DOS "user" is similar to UNIX's "superuser," but can't write
  971.        * to write-protected files.  The execute permission bit is set
  972. ***************
  973. *** 2488,2493 ****
  974. --- 2594,2602 ----
  975.        *        Sun's PC-NFS.]
  976.        */
  977.   
  978. +      /* Atari stat() does pretty much the same thing. we set x_bit_set_in_stat
  979. +       * too so it will actually look into the files for magic numbers
  980. +       */
  981.        return (bit & statbufp->st_mode) ? TRUE : FALSE;
  982.   
  983.   #else /* ! MSDOS */
  984. ***************
  985. *** 2658,2664 ****
  986.       {
  987.   #ifdef HAS_MSG
  988.       case O_MSGCTL:
  989. !     ret = msgctl(id, cmd, a);
  990.       break;
  991.   #endif
  992.   #ifdef HAS_SEM
  993. --- 2767,2773 ----
  994.       {
  995.   #ifdef HAS_MSG
  996.       case O_MSGCTL:
  997. !     ret = msgctl(id, cmd, (struct msqid_ds *)a);
  998.       break;
  999.   #endif
  1000.   #ifdef HAS_SEM
  1001. ***************
  1002. *** 2668,2674 ****
  1003.   #endif
  1004.   #ifdef HAS_SHM
  1005.       case O_SHMCTL:
  1006. !     ret = shmctl(id, cmd, a);
  1007.       break;
  1008.   #endif
  1009.       }
  1010. --- 2777,2783 ----
  1011.   #endif
  1012.   #ifdef HAS_SHM
  1013.       case O_SHMCTL:
  1014. !     ret = shmctl(id, cmd, (struct shmid_ds *)a);
  1015.       break;
  1016.   #endif
  1017.       }
  1018. ***************
  1019. *** 2699,2705 ****
  1020.       return -1;
  1021.       }
  1022.       errno = 0;
  1023. !     return msgsnd(id, mbuf, msize, flags);
  1024.   #else
  1025.       fatal("msgsnd not implemented");
  1026.   #endif
  1027. --- 2808,2814 ----
  1028.       return -1;
  1029.       }
  1030.       errno = 0;
  1031. !     return msgsnd(id, (struct msgbuf *)mbuf, msize, flags);
  1032.   #else
  1033.       fatal("msgsnd not implemented");
  1034.   #endif
  1035. ***************
  1036. *** 2728,2734 ****
  1037.       mbuf = str_get(mstr);
  1038.       }
  1039.       errno = 0;
  1040. !     ret = msgrcv(id, mbuf, msize, mtype, flags);
  1041.       if (ret >= 0) {
  1042.       mstr->str_cur = sizeof(long)+ret;
  1043.       mstr->str_ptr[sizeof(long)+ret] = '\0';
  1044. --- 2837,2843 ----
  1045.       mbuf = str_get(mstr);
  1046.       }
  1047.       errno = 0;
  1048. !     ret = msgrcv(id, (struct msgbuf *)mbuf, msize, mtype, flags);
  1049.       if (ret >= 0) {
  1050.       mstr->str_cur = sizeof(long)+ret;
  1051.       mstr->str_ptr[sizeof(long)+ret] = '\0';
  1052. ***************
  1053. *** 2802,2808 ****
  1054.           STR_GROW(mstr, msize+1);
  1055.           mbuf = str_get(mstr);
  1056.       }
  1057. !     bcopy(shm + mpos, mbuf, msize);
  1058.       mstr->str_cur = msize;
  1059.       mstr->str_ptr[msize] = '\0';
  1060.       }
  1061. --- 2911,2917 ----
  1062.           STR_GROW(mstr, msize+1);
  1063.           mbuf = str_get(mstr);
  1064.       }
  1065. !     Copy(shm + mpos, mbuf, msize, char);
  1066.       mstr->str_cur = msize;
  1067.       mstr->str_ptr[msize] = '\0';
  1068.       }
  1069. ***************
  1070. *** 2811,2819 ****
  1071.   
  1072.       if ((n = mstr->str_cur) > msize)
  1073.           n = msize;
  1074. !     bcopy(mbuf, shm + mpos, n);
  1075.       if (n < msize)
  1076. !         bzero(shm + mpos + n, msize - n);
  1077.       }
  1078.       return shmdt(shm);
  1079.   #else
  1080. --- 2920,2928 ----
  1081.   
  1082.       if ((n = mstr->str_cur) > msize)
  1083.           n = msize;
  1084. !     Copy(mbuf, shm + mpos, n, char);
  1085.       if (n < msize)
  1086. !         memzero(shm + mpos + n, msize - n);
  1087.       }
  1088.       return shmdt(shm);
  1089.   #else
  1090.  
  1091. Index: form.c
  1092. *** form.c.old    Mon Jun  8 17:47:24 1992
  1093. --- form.c    Mon Jun  8 17:47:25 1992
  1094. ***************
  1095. *** 1,4 ****
  1096. ! /* $RCSfile: form.c,v $$Revision: 4.0.1.2 $$Date: 91/11/05 17:18:43 $
  1097.    *
  1098.    *    Copyright (c) 1991, Larry Wall
  1099.    *
  1100. --- 1,4 ----
  1101. ! /* $RCSfile: form.c,v $$Revision: 4.0.1.3 $$Date: 92/06/08 13:21:42 $
  1102.    *
  1103.    *    Copyright (c) 1991, Larry Wall
  1104.    *
  1105. ***************
  1106. *** 6,11 ****
  1107. --- 6,16 ----
  1108.    *    License or the Artistic License, as specified in the README file.
  1109.    *
  1110.    * $Log:    form.c,v $
  1111. +  * Revision 4.0.1.3  92/06/08  13:21:42  lwall
  1112. +  * patch20: removed implicit int declarations on funcions
  1113. +  * patch20: form feed for formats is now specifiable via $^L
  1114. +  * patch20: Perl now distinguishes overlapped copies from non-overlapped
  1115. +  * 
  1116.    * Revision 4.0.1.2  91/11/05  17:18:43  lwall
  1117.    * patch11: formats didn't fill their fields as well as they could
  1118.    * patch11: ^ fields chopped hyphens on line break
  1119. ***************
  1120. *** 25,30 ****
  1121. --- 30,37 ----
  1122.   
  1123.   /* Forms stuff */
  1124.   
  1125. + static int countlines();
  1126.   void
  1127.   form_parseargs(fcmd)
  1128.   register FCMD *fcmd;
  1129. ***************
  1130. *** 80,85 ****
  1131. --- 87,93 ----
  1132.       curlen = orec->o_len - 2; \
  1133.   }
  1134.   
  1135. + void
  1136.   format(orec,fcmd,sp)
  1137.   register struct outrec *orec;
  1138.   register FCMD *fcmd;
  1139. ***************
  1140. *** 219,225 ****
  1141.           *d++ = ' ';
  1142.           }
  1143.           size = s - t;
  1144. !         (void)bcopy(t,d,size);
  1145.           d += size;
  1146.           *s = tmpchar;
  1147.           if (fcmd->f_flags & FC_CHOP)
  1148. --- 227,233 ----
  1149.           *d++ = ' ';
  1150.           }
  1151.           size = s - t;
  1152. !         Copy(t,d,size,char);
  1153.           d += size;
  1154.           *s = tmpchar;
  1155.           if (fcmd->f_flags & FC_CHOP)
  1156. ***************
  1157. *** 264,270 ****
  1158.           *d++ = ' ';
  1159.           }
  1160.           size = s - t;
  1161. !         (void)bcopy(t,d,size);
  1162.           d += size;
  1163.           *s = tmpchar;
  1164.           if (fcmd->f_next && fcmd->f_next->f_pre[0] == '\n')
  1165. --- 272,278 ----
  1166.           *d++ = ' ';
  1167.           }
  1168.           size = s - t;
  1169. !         Copy(t,d,size,char);
  1170.           d += size;
  1171.           *s = tmpchar;
  1172.           if (fcmd->f_next && fcmd->f_next->f_pre[0] == '\n')
  1173. ***************
  1174. *** 286,292 ****
  1175.           size = str_len(str);
  1176.           CHKLEN(size+1);
  1177.           orec->o_lines += countlines(s,size) - 1;
  1178. !         (void)bcopy(s,d,size);
  1179.           d += size;
  1180.           if (size && s[size-1] != '\n') {
  1181.           *d++ = '\n';
  1182. --- 294,300 ----
  1183.           size = str_len(str);
  1184.           CHKLEN(size+1);
  1185.           orec->o_lines += countlines(s,size) - 1;
  1186. !         Copy(s,d,size,char);
  1187.           d += size;
  1188.           if (size && s[size-1] != '\n') {
  1189.           *d++ = '\n';
  1190. ***************
  1191. *** 325,330 ****
  1192. --- 333,339 ----
  1193.       *d++ = '\0';
  1194.   }
  1195.   
  1196. + static int
  1197.   countlines(s,size)
  1198.   register char *s;
  1199.   register int size;
  1200. ***************
  1201. *** 338,343 ****
  1202. --- 347,353 ----
  1203.       return count;
  1204.   }
  1205.   
  1206. + void
  1207.   do_write(orec,stab,sp)
  1208.   struct outrec *orec;
  1209.   STAB *stab;
  1210. ***************
  1211. *** 374,380 ****
  1212.           stio->top_stab = topstab;
  1213.       }
  1214.       if (stio->lines_left >= 0 && stio->page > 0)
  1215. !         (void)putc('\f',ofp);
  1216.       stio->lines_left = stio->page_len;
  1217.       stio->page++;
  1218.       format(&toprec,stab_form(stio->top_stab),sp);
  1219. --- 384,390 ----
  1220.           stio->top_stab = topstab;
  1221.       }
  1222.       if (stio->lines_left >= 0 && stio->page > 0)
  1223. !         fwrite(formfeed->str_ptr, formfeed->str_cur, 1, ofp);
  1224.       stio->lines_left = stio->page_len;
  1225.       stio->page++;
  1226.       format(&toprec,stab_form(stio->top_stab),sp);
  1227.  
  1228. Index: atarist/test/gdbm
  1229. *** atarist/test/gdbm.old    Mon Jun  8 17:45:03 1992
  1230. --- atarist/test/gdbm    Mon Jun  8 17:45:04 1992
  1231. ***************
  1232. *** 0 ****
  1233. --- 1,28 ----
  1234. + die "cant create dbmtest" unless dbmopen(%keys, "dbmtest", 0666);
  1235. + print "Writing...\n";
  1236. + foreach (0..100) {
  1237. +     $keys{"$_"} = $_;
  1238. + }
  1239. + print "Done\n";
  1240. + dbmclose (%keys);
  1241. + die "cant read dbmtest" unless dbmopen(%rkeys, "dbmtest", undef);
  1242. + $i = 0;
  1243. + print "Reading...\n";
  1244. + while (($key, $val) = each %rkeys)
  1245. + {
  1246. +   if ($keys{$key} != $val)
  1247. +   {
  1248. +      print 'Incorrect val ', $key, ' = ', $val, ' expecting ', $keys{$key}, "\n";
  1249. +      $i = $i + 1;
  1250. +   }
  1251. + }
  1252. + print "Done\n";
  1253. + dbmclose (%keys);
  1254. + print $i, " Error(s)\n";
  1255. + unlink "dbmtest";
  1256.  
  1257. Index: atarist/test/gdbm.t
  1258. *** atarist/test/gdbm.t.old    Mon Jun  8 17:45:06 1992
  1259. --- atarist/test/gdbm.t    Mon Jun  8 17:45:06 1992
  1260. ***************
  1261. *** 0 ****
  1262. --- 1,101 ----
  1263. + #!./perl
  1264. + #
  1265. + # based on t/op/dbm.t modified for gdbm and atariST stat() semantics
  1266. + #
  1267. + print "1..12\n";
  1268. + unlink <Op.dbm>;
  1269. + umask(0);
  1270. + print (dbmopen(h,'Op.dbm',0640) ? "ok 1\n" : "not ok 1\n");
  1271. + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1272. +    $blksize,$blocks) = stat('Op.dbm');
  1273. + print (($mode & 0770) == 0640 ? "ok 2\n" : "not ok 2\n");
  1274. + while (($key,$value) = each(h)) {
  1275. +     $i++;
  1276. + }
  1277. + print (!$i ? "ok 3\n" : "not ok 3\n");
  1278. + $h{'goner1'} = 'snork';
  1279. + $h{'abc'} = 'ABC';
  1280. + $h{'def'} = 'DEF';
  1281. + $h{'jkl','mno'} = "JKL\034MNO";
  1282. + $h{'a',2,3,4,5} = join("\034",'A',2,3,4,5);
  1283. + $h{'a'} = 'A';
  1284. + $h{'b'} = 'B';
  1285. + $h{'c'} = 'C';
  1286. + $h{'d'} = 'D';
  1287. + $h{'e'} = 'E';
  1288. + $h{'f'} = 'F';
  1289. + $h{'g'} = 'G';
  1290. + $h{'h'} = 'H';
  1291. + $h{'i'} = 'I';
  1292. + $h{'goner2'} = 'snork';
  1293. + delete $h{'goner2'};
  1294. + dbmclose(h);
  1295. + print (dbmopen(h,'Op.dbm',0640) ? "ok 4\n" : "not ok 4\n");
  1296. + $h{'j'} = 'J';
  1297. + $h{'k'} = 'K';
  1298. + $h{'l'} = 'L';
  1299. + $h{'m'} = 'M';
  1300. + $h{'n'} = 'N';
  1301. + $h{'o'} = 'O';
  1302. + $h{'p'} = 'P';
  1303. + $h{'q'} = 'Q';
  1304. + $h{'r'} = 'R';
  1305. + $h{'s'} = 'S';
  1306. + $h{'t'} = 'T';
  1307. + $h{'u'} = 'U';
  1308. + $h{'v'} = 'V';
  1309. + $h{'w'} = 'W';
  1310. + $h{'x'} = 'X';
  1311. + $h{'y'} = 'Y';
  1312. + $h{'z'} = 'Z';
  1313. + $h{'goner3'} = 'snork';
  1314. + delete $h{'goner1'};
  1315. + delete $h{'goner3'};
  1316. + @keys = keys(%h);
  1317. + @values = values(%h);
  1318. + if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";}
  1319. + while (($key,$value) = each(h)) {
  1320. +     if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) {
  1321. +     $key =~ y/a-z/A-Z/;
  1322. +     $i++ if $key eq $value;
  1323. +     }
  1324. + }
  1325. + if ($i == 30) {print "ok 6\n";} else {print "not ok 6\n";}
  1326. + @keys = ('blurfl', keys(h), 'dyick');
  1327. + if ($#keys == 31) {print "ok 7\n";} else {print "not ok 7\n";}
  1328. + $h{'foo'} = '';
  1329. + $h{''} = 'bar';
  1330. + # check cache overflow and numeric keys and contents
  1331. + $ok = 1;
  1332. + for ($i = 1; $i < 200; $i++) { $h{$i + 0} = $i + 0; }
  1333. + for ($i = 1; $i < 200; $i++) { $ok = 0 unless $h{$i} == $i; }
  1334. + print ($ok ? "ok 8\n" : "not ok 8\n");
  1335. + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1336. +    $blksize,$blocks) = stat('Op.dbm');
  1337. + print ($size > 0 ? "ok 9\n" : "not ok 9\n");
  1338. + @h{0..200} = 200..400;
  1339. + @foo = @h{0..200};
  1340. + print join(':',200..400) eq join(':',@foo) ? "ok 10\n" : "not ok 10\n";
  1341. + print ($h{'foo'} eq '' ? "ok 11\n" : "not ok 11\n");
  1342. + print ($h{''} eq 'bar' ? "ok 12\n" : "not ok 12\n");
  1343. + unlink 'Op.dbm';
  1344.  
  1345. Index: os2/glob.c
  1346. *** os2/glob.c.old    Mon Jun  8 17:49:54 1992
  1347. --- os2/glob.c    Mon Jun  8 17:49:54 1992
  1348. ***************
  1349. *** 1,18 ****
  1350.   /*
  1351.    * Globbing for OS/2.  Relies on the expansion done by the library
  1352. !  * startup code. (dds)
  1353.    */
  1354.   
  1355. ! #include <stdio.h>
  1356. ! #include <string.h>
  1357.   
  1358. ! main(int argc, char *argv[])
  1359.   {
  1360. !   register i;
  1361.   
  1362.     for (i = 1; i < argc; i++)
  1363.     {
  1364. !     fputs(IsFileSystemFAT(argv[i]) ? strlwr(argv[i]) : argv[i], stdout);
  1365. !     putchar(0);
  1366.     }
  1367.   }
  1368. --- 1,21 ----
  1369.   /*
  1370.    * Globbing for OS/2.  Relies on the expansion done by the library
  1371. !  * startup code.
  1372.    */
  1373.   
  1374. ! #define PERLGLOB
  1375. ! #include "director.c"
  1376.   
  1377. ! int main(int argc, char **argv)
  1378.   {
  1379. !   SHORT i;
  1380. !   USHORT r;
  1381. !   CHAR *f;
  1382.   
  1383.     for (i = 1; i < argc; i++)
  1384.     {
  1385. !     f = IsFileSystemFAT(argv[i]) ? strlwr(argv[i]) : argv[i];
  1386. !     DosWrite(1, f, strlen(f) + 1, &r);
  1387.     }
  1388. +   return argc - 1;
  1389.   }
  1390.  
  1391. Index: t/op/goto.t
  1392. Prereq: 4.0
  1393. *** t/op/goto.t.old    Mon Jun  8 17:52:07 1992
  1394. --- t/op/goto.t    Mon Jun  8 17:52:08 1992
  1395. ***************
  1396. *** 1,6 ****
  1397.   #!./perl
  1398.   
  1399. ! # $Header: goto.t,v 4.0 91/03/20 01:52:52 lwall Locked $
  1400.   
  1401.   print "1..3\n";
  1402.   
  1403. --- 1,6 ----
  1404.   #!./perl
  1405.   
  1406. ! # $RCSfile: goto.t,v $$Revision: 4.0.1.1 $$Date: 92/06/08 15:43:25 $
  1407.   
  1408.   print "1..3\n";
  1409.   
  1410. ***************
  1411. *** 30,34 ****
  1412.   if ($foo == 4) {print "ok 2\n";} else {print "not ok 2\n";}
  1413.   
  1414.   $x = `./perl -e 'goto foo;' 2>&1`;
  1415. - print "#3\t/label/ in :$x";
  1416.   if ($x =~ /label/) {print "ok 3\n";} else {print "not ok 3\n";}
  1417. --- 30,33 ----
  1418.  
  1419. Index: h2ph.SH
  1420. *** h2ph.SH.old    Mon Jun  8 17:47:28 1992
  1421. --- h2ph.SH    Mon Jun  8 17:47:29 1992
  1422. ***************
  1423. *** 19,24 ****
  1424. --- 19,25 ----
  1425.   : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
  1426.   : Protect any dollar signs and backticks that you do not want interpreted
  1427.   : by putting a backslash in front.  You may delete these comments.
  1428. + rm -f h2ph
  1429.   $spitshell >h2ph <<!GROK!THIS!
  1430.   #!$bin/perl
  1431.   'di';
  1432.  
  1433. Index: handy.h
  1434. *** handy.h.old    Mon Jun  8 17:47:31 1992
  1435. --- handy.h    Mon Jun  8 17:47:32 1992
  1436. ***************
  1437. *** 1,4 ****
  1438. ! /* $RCSfile: handy.h,v $$Revision: 4.0.1.3 $$Date: 91/11/05 22:54:26 $
  1439.    *
  1440.    *    Copyright (c) 1991, Larry Wall
  1441.    *
  1442. --- 1,4 ----
  1443. ! /* $RCSfile: handy.h,v $$Revision: 4.0.1.4 $$Date: 92/06/08 13:23:17 $
  1444.    *
  1445.    *    Copyright (c) 1991, Larry Wall
  1446.    *
  1447. ***************
  1448. *** 6,11 ****
  1449. --- 6,15 ----
  1450.    *    License or the Artistic License, as specified in the README file.
  1451.    *
  1452.    * $Log:    handy.h,v $
  1453. +  * Revision 4.0.1.4  92/06/08  13:23:17  lwall
  1454. +  * patch20: isascii() may now be supplied by a library routine
  1455. +  * patch20: Perl now distinguishes overlapped copies from non-overlapped
  1456. +  * 
  1457.    * Revision 4.0.1.3  91/11/05  22:54:26  lwall
  1458.    * patch11: erratum
  1459.    * 
  1460. ***************
  1461. *** 58,64 ****
  1462.   #define strnNE(s1,s2,l) (strncmp(s1,s2,l))
  1463.   #define strnEQ(s1,s2,l) (!strncmp(s1,s2,l))
  1464.   
  1465. ! #if defined(CTYPE256) || !defined(isascii)
  1466.   #define isALNUM(c) (isalpha(c) || isdigit(c) || c == '_')
  1467.   #define isALPHA(c) isalpha(c)
  1468.   #define isSPACE(c) isspace(c)
  1469. --- 62,68 ----
  1470.   #define strnNE(s1,s2,l) (strncmp(s1,s2,l))
  1471.   #define strnEQ(s1,s2,l) (!strncmp(s1,s2,l))
  1472.   
  1473. ! #if defined(CTYPE256) || (!defined(isascii) && !defined(HAS_ISASCII))
  1474.   #define isALNUM(c) (isalpha(c) || isdigit(c) || c == '_')
  1475.   #define isALPHA(c) isalpha(c)
  1476.   #define isSPACE(c) isspace(c)
  1477. ***************
  1478. *** 74,81 ****
  1479.   #define isLOWER(c) (isascii(c) && islower(c))
  1480.   #endif
  1481.   
  1482. - #define MEM_SIZE unsigned int
  1483.   /* Line numbers are unsigned, 16 bits. */
  1484.   typedef unsigned short line_t;
  1485.   #ifdef lint
  1486. --- 78,83 ----
  1487. ***************
  1488. *** 95,101 ****
  1489.   #define New(x,v,n,t)  (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t))))
  1490.   #define Newc(x,v,n,t,c)  (v = (c*)safemalloc((MEM_SIZE)((n) * sizeof(t))))
  1491.   #define Newz(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t)))), \
  1492. !     bzero((char*)(v), (n) * sizeof(t))
  1493.   #define Renew(v,n,t) (v = (t*)saferealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1494.   #define Renewc(v,n,t,c) (v = (c*)saferealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1495.   #else
  1496. --- 97,103 ----
  1497.   #define New(x,v,n,t)  (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t))))
  1498.   #define Newc(x,v,n,t,c)  (v = (c*)safemalloc((MEM_SIZE)((n) * sizeof(t))))
  1499.   #define Newz(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t)))), \
  1500. !     memzero((char*)(v), (n) * sizeof(t))
  1501.   #define Renew(v,n,t) (v = (t*)saferealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1502.   #define Renewc(v,n,t,c) (v = (c*)saferealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1503.   #else
  1504. ***************
  1505. *** 102,108 ****
  1506.   #define New(x,v,n,t)  (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t))))
  1507.   #define Newc(x,v,n,t,c)  (v = (c*)safemalloc(((unsigned long)(n) * sizeof(t))))
  1508.   #define Newz(x,v,n,t) (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t)))), \
  1509. !     bzero((char*)(v), (n) * sizeof(t))
  1510.   #define Renew(v,n,t) (v = (t*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
  1511.   #define Renewc(v,n,t,c) (v = (c*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
  1512.   #endif /* MSDOS */
  1513. --- 104,110 ----
  1514.   #define New(x,v,n,t)  (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t))))
  1515.   #define Newc(x,v,n,t,c)  (v = (c*)safemalloc(((unsigned long)(n) * sizeof(t))))
  1516.   #define Newz(x,v,n,t) (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t)))), \
  1517. !     memzero((char*)(v), (n) * sizeof(t))
  1518.   #define Renew(v,n,t) (v = (t*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
  1519.   #define Renewc(v,n,t,c) (v = (c*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
  1520.   #endif /* MSDOS */
  1521. ***************
  1522. *** 115,121 ****
  1523.   #define New(x,v,n,t)  (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t))))
  1524.   #define Newc(x,v,n,t,c)  (v = (c*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t))))
  1525.   #define Newz(x,v,n,t) (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))), \
  1526. !     bzero((char*)(v), (n) * sizeof(t))
  1527.   #define Renew(v,n,t) (v = (t*)safexrealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1528.   #define Renewc(v,n,t,c) (v = (c*)safexrealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1529.   #define Safefree(d) safexfree((char*)d)
  1530. --- 117,123 ----
  1531.   #define New(x,v,n,t)  (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t))))
  1532.   #define Newc(x,v,n,t,c)  (v = (c*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t))))
  1533.   #define Newz(x,v,n,t) (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))), \
  1534. !     memzero((char*)(v), (n) * sizeof(t))
  1535.   #define Renew(v,n,t) (v = (t*)safexrealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1536.   #define Renewc(v,n,t,c) (v = (c*)safexrealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t))))
  1537.   #define Safefree(d) safexfree((char*)d)
  1538. ***************
  1539. *** 124,137 ****
  1540.   long xcount[MAXXCOUNT];
  1541.   long lastxcount[MAXXCOUNT];
  1542.   #endif /* LEAKTEST */
  1543. ! #define Copy(s,d,n,t) (void)bcopy((char*)(s),(char*)(d), (n) * sizeof(t))
  1544. ! #define Zero(d,n,t) (void)bzero((char*)(d), (n) * sizeof(t))
  1545.   #else /* lint */
  1546.   #define New(x,v,n,s) (v = Null(s *))
  1547.   #define Newc(x,v,n,s,c) (v = Null(s *))
  1548.   #define Newz(x,v,n,s) (v = Null(s *))
  1549.   #define Renew(v,n,s) (v = Null(s *))
  1550.   #define Copy(s,d,n,t)
  1551.   #define Zero(d,n,t)
  1552.   #define Safefree(d) d = d
  1553.   #endif /* lint */
  1554. --- 126,147 ----
  1555.   long xcount[MAXXCOUNT];
  1556.   long lastxcount[MAXXCOUNT];
  1557.   #endif /* LEAKTEST */
  1558. ! #define Move(s,d,n,t) (void)memmove((char*)(d),(char*)(s), (n) * sizeof(t))
  1559. ! #define Copy(s,d,n,t) (void)memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
  1560. ! #define Zero(d,n,t) (void)memzero((char*)(d), (n) * sizeof(t))
  1561.   #else /* lint */
  1562.   #define New(x,v,n,s) (v = Null(s *))
  1563.   #define Newc(x,v,n,s,c) (v = Null(s *))
  1564.   #define Newz(x,v,n,s) (v = Null(s *))
  1565.   #define Renew(v,n,s) (v = Null(s *))
  1566. + #define Move(s,d,n,t)
  1567.   #define Copy(s,d,n,t)
  1568.   #define Zero(d,n,t)
  1569.   #define Safefree(d) d = d
  1570.   #endif /* lint */
  1571. + #ifdef STRUCTCOPY
  1572. + #define StructCopy(s,d,t) *((t*)(d)) = *((t*)(s))
  1573. + #else
  1574. + #define StructCopy(s,d,t) Copy(s,d,1,t)
  1575. + #endif
  1576.  
  1577. Index: hash.c
  1578. *** hash.c.old    Mon Jun  8 17:47:34 1992
  1579. --- hash.c    Mon Jun  8 17:47:35 1992
  1580. ***************
  1581. *** 1,4 ****
  1582. ! /* $RCSfile: hash.c,v $$Revision: 4.0.1.2 $$Date: 91/11/05 17:24:13 $
  1583.    *
  1584.    *    Copyright (c) 1991, Larry Wall
  1585.    *
  1586. --- 1,4 ----
  1587. ! /* $RCSfile: hash.c,v $$Revision: 4.0.1.3 $$Date: 92/06/08 13:26:29 $
  1588.    *
  1589.    *    Copyright (c) 1991, Larry Wall
  1590.    *
  1591. ***************
  1592. *** 6,11 ****
  1593. --- 6,16 ----
  1594.    *    License or the Artistic License, as specified in the README file.
  1595.    *
  1596.    * $Log:    hash.c,v $
  1597. +  * Revision 4.0.1.3  92/06/08  13:26:29  lwall
  1598. +  * patch20: removed implicit int declarations on functions
  1599. +  * patch20: delete could cause %array to give too low a count of buckets filled
  1600. +  * patch20: hash tables now split only if the memory is available to do so
  1601. +  * 
  1602.    * Revision 4.0.1.2  91/11/05  17:24:13  lwall
  1603.    * patch11: saberized perl
  1604.    * 
  1605. ***************
  1606. *** 20,25 ****
  1607. --- 25,32 ----
  1608.   #include "EXTERN.h"
  1609.   #include "perl.h"
  1610.   
  1611. + static void hsplit();
  1612.   static char coeff[] = {
  1613.           61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
  1614.           61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
  1615. ***************
  1616. *** 247,256 ****
  1617.       if (bcmp(entry->hent_key,key,klen))    /* is this it? */
  1618.           continue;
  1619.       *oentry = entry->hent_next;
  1620.       str = str_mortal(entry->hent_val);
  1621.       hentfree(entry);
  1622. -     if (i)
  1623. -         tb->tbl_fill--;
  1624.   #ifdef SOME_DBM
  1625.         do_dbm_delete:
  1626.       if (tb->tbl_dbm) {
  1627. --- 254,263 ----
  1628.       if (bcmp(entry->hent_key,key,klen))    /* is this it? */
  1629.           continue;
  1630.       *oentry = entry->hent_next;
  1631. +     if (i && !*oentry)
  1632. +         tb->tbl_fill--;
  1633.       str = str_mortal(entry->hent_val);
  1634.       hentfree(entry);
  1635.   #ifdef SOME_DBM
  1636.         do_dbm_delete:
  1637.       if (tb->tbl_dbm) {
  1638. ***************
  1639. *** 273,278 ****
  1640. --- 280,286 ----
  1641.   #endif
  1642.   }
  1643.   
  1644. + static void
  1645.   hsplit(tb)
  1646.   HASH *tb;
  1647.   {
  1648. ***************
  1649. *** 285,291 ****
  1650. --- 293,305 ----
  1651.       register HENT **oentry;
  1652.   
  1653.       a = tb->tbl_array;
  1654. +     nomemok = TRUE;
  1655.       Renew(a, newsize, HENT*);
  1656. +     nomemok = FALSE;
  1657. +     if (!a) {
  1658. +     tb->tbl_dosplit = tb->tbl_max + 1;    /* never split again */
  1659. +     return;
  1660. +     }
  1661.       Zero(&a[oldsize], oldsize, HENT*);        /* zero 2nd half*/
  1662.       tb->tbl_max = --newsize;
  1663.       tb->tbl_dosplit = tb->tbl_max * FILLPCT / 100;
  1664. ***************
  1665. *** 369,375 ****
  1666.       tb->tbl_fill = 0;
  1667.   #ifndef lint
  1668.       if (tb->tbl_array)
  1669. !     (void)bzero((char*)tb->tbl_array, (tb->tbl_max + 1) * sizeof(HENT*));
  1670.   #endif
  1671.   }
  1672.   
  1673. --- 383,389 ----
  1674.       tb->tbl_fill = 0;
  1675.   #ifndef lint
  1676.       if (tb->tbl_array)
  1677. !     (void)memzero((char*)tb->tbl_array, (tb->tbl_max + 1) * sizeof(HENT*));
  1678.   #endif
  1679.   }
  1680.   
  1681.  
  1682. Index: hints/hp9000_700.sh
  1683. *** hints/hp9000_700.sh.old    Mon Jun  8 17:47:54 1992
  1684. --- hints/hp9000_700.sh    Mon Jun  8 17:47:55 1992
  1685. ***************
  1686. *** 0 ****
  1687. --- 1,5 ----
  1688. + libswanted='ndbm m'
  1689. + ccflags="$ccflags -DJMPCLOBBER"
  1690. + optimize='+O1'
  1691. + d_mymalloc=define
  1692. + alignbytes=8
  1693.  
  1694. Index: hints/hp9000_800.sh
  1695. *** hints/hp9000_800.sh.old    Mon Jun  8 17:47:56 1992
  1696. --- hints/hp9000_800.sh    Mon Jun  8 17:47:57 1992
  1697. ***************
  1698. *** 1,2 ****
  1699.   libswanted=`echo $libswanted | sed -e 's/malloc //' -e 's/BSD //`
  1700. ! optimize='+O1'
  1701. --- 1,3 ----
  1702.   libswanted=`echo $libswanted | sed -e 's/malloc //' -e 's/BSD //`
  1703. ! eval_cflags='optimize=+O1'
  1704. ! teval_cflags=$eval_cflags
  1705.  
  1706. Index: hints/hpux.sh
  1707. *** hints/hpux.sh.old    Mon Jun  8 17:47:59 1992
  1708. --- hints/hpux.sh    Mon Jun  8 17:47:59 1992
  1709. ***************
  1710. *** 5,7 ****
  1711. --- 5,8 ----
  1712.   *3.1*) d_syscall=$undef ;;
  1713.   *2.1*) libswanted=`echo $libswanted | sed 's/ malloc / /'` ;;
  1714.   esac
  1715. + d_index=define
  1716.  
  1717. Index: installperl
  1718. *** installperl.old    Mon Jun  8 17:48:36 1992
  1719. --- installperl    Mon Jun  8 17:48:36 1992
  1720. ***************
  1721. *** 1,5 ****
  1722. --- 1,7 ----
  1723.   #!./perl
  1724.   
  1725. + $mainperldir = "/usr/bin";
  1726.   while (@ARGV) {
  1727.       $nonono = 1 if $ARGV[0] eq '-n';
  1728.       $versiononly = 1 if $ARGV[0] eq '-v';
  1729. ***************
  1730. *** 11,20 ****
  1731.   @scripts = ('cppstdin', 'h2ph', 'c2ph', 'pstruct', 'x2p/s2p', 'x2p/find2perl');
  1732.   @manpages = ('perl.man', 'h2ph.man', 'x2p/a2p.man', 'x2p/s2p.man');
  1733.   
  1734. - $version = sprintf("%5.3f", $]);
  1735. - $release = substr($version,0,3);
  1736. - $patchlevel = substr($version,3,2);
  1737.   # Read in the config file.
  1738.   
  1739.   open(CONFIG, "config.sh") || die "You haven't run Configure yet!\n";
  1740. --- 13,18 ----
  1741. ***************
  1742. *** 26,32 ****
  1743. --- 24,43 ----
  1744.       }
  1745.       $accum .= $_;
  1746.   }
  1747. + close CONFIG;
  1748.   
  1749. + open(PERL_C, "perl.c");
  1750. + while (<PERL_C>) {
  1751. +     last if /Revision:/;
  1752. + }
  1753. + close PERL_C;
  1754. + s/.*Revision: //;
  1755. + $major = $_ + 0;
  1756. + $ver = sprintf("%5.3f", $major + $PATCHLEVEL / 1000);
  1757. + $release = substr($ver,0,3);
  1758. + $patchlevel = substr($ver,3,2);
  1759.   # Do some quick sanity checks.
  1760.   
  1761.   if ($d_dosuid && $>) { die "You must run as root to install suidperl\n"; }
  1762. ***************
  1763. *** 45,52 ****
  1764.   
  1765.   # First we install the version-numbered executables.
  1766.   
  1767. - $ver = sprintf("%5.3f", $]);
  1768.   &unlink("$installbin/perl$ver");
  1769.   &cmd("cp perl $installbin/perl$ver");
  1770.   
  1771. --- 56,61 ----
  1772. ***************
  1773. *** 80,96 ****
  1774.   if ($bdev != $ddev || $bino != $dino) {
  1775.       &unlink("$installbin/a2p");
  1776.       &cmd("cp x2p/a2p $installbin/a2p");
  1777.   }
  1778.   
  1779.   # Make some enemies in the name of standardization.   :-)
  1780.   
  1781. ! ($udev,$uino) = stat("/usr/bin");
  1782.   
  1783. ! if (-w _ && ($udev != $ddev || $uino != $dino) && !$nonono) {
  1784. !     &unlink("/usr/bin/perl");
  1785. !     eval 'symlink("$installbin/perl", "/usr/bin/perl")' ||
  1786. !     eval 'link("$installbin/perl", "/usr/bin/perl")' ||
  1787. !     &cmd("cp $installbin/perl /usr/bin");
  1788.   }
  1789.   
  1790.   # Install scripts.
  1791. --- 89,106 ----
  1792.   if ($bdev != $ddev || $bino != $dino) {
  1793.       &unlink("$installbin/a2p");
  1794.       &cmd("cp x2p/a2p $installbin/a2p");
  1795. +     &chmod(0755, "$installbin/a2p");
  1796.   }
  1797.   
  1798.   # Make some enemies in the name of standardization.   :-)
  1799.   
  1800. ! ($udev,$uino) = stat($mainperldir);
  1801.   
  1802. ! if (-w _ && ($udev != $bdev || $uino != $bino) && !$nonono) {
  1803. !     &unlink("$mainperldir/perl");
  1804. !     eval 'link("$installbin/perl", "$mainperldir/perl")' ||
  1805. !     eval 'symlink("$installbin/perl", "$mainperldir/perl")' ||
  1806. !     &cmd("cp $installbin/perl $mainperldir");
  1807.   }
  1808.   
  1809.   # Install scripts.
  1810. ***************
  1811. *** 114,121 ****
  1812.           $new =~ s#.*/##;
  1813.           print STDERR "  Installing $mansrc/$new\n";
  1814.           next if $nonono;
  1815. !         open(MI,$_);
  1816. !         open(MO,">$mansrc/$new");
  1817.           print MO ".ds RP Release $release Patchlevel $patchlevel\n";
  1818.           while (<MI>) {
  1819.           print MO;
  1820. --- 124,131 ----
  1821.           $new =~ s#.*/##;
  1822.           print STDERR "  Installing $mansrc/$new\n";
  1823.           next if $nonono;
  1824. !         open(MI,$_) || warn "Can't open $_: $!\n";
  1825. !         open(MO,">$mansrc/$new") || warn "Can't install $mansrc/$new: $!\n";
  1826.           print MO ".ds RP Release $release Patchlevel $patchlevel\n";
  1827.           while (<MI>) {
  1828.           print MO;
  1829.  
  1830. Index: hints/isc_3_2_2.sh
  1831. *** hints/isc_3_2_2.sh.old    Mon Jun  8 17:48:01 1992
  1832. --- hints/isc_3_2_2.sh    Mon Jun  8 17:48:01 1992
  1833. ***************
  1834. *** 1,4 ****
  1835. ! set `echo $libswanted | sed -e 's/ x / /' -e 's/ PW / /' -e s/ malloc / /`
  1836.   libswanted="inet malloc $*"
  1837.   doio_cflags='ccflags="$ccflags -DENOTSOCK=103"'
  1838.   tdoio_cflags='ccflags="$ccflags -DENOTSOCK=103"'
  1839. --- 1,4 ----
  1840. ! set `echo $libswanted | sed -e 's/ x / /' -e 's/ PW / /' -e 's/ malloc / /'`
  1841.   libswanted="inet malloc $*"
  1842.   doio_cflags='ccflags="$ccflags -DENOTSOCK=103"'
  1843.   tdoio_cflags='ccflags="$ccflags -DENOTSOCK=103"'
  1844.  
  1845. Index: makedir.SH
  1846. Prereq: 4.0
  1847. *** makedir.SH.old    Mon Jun  8 17:49:24 1992
  1848. --- makedir.SH    Mon Jun  8 17:49:25 1992
  1849. ***************
  1850. *** 13,23 ****
  1851.   */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  1852.   esac
  1853.   echo "Extracting makedir (with variable substitutions)"
  1854.   $spitshell >makedir <<!GROK!THIS!
  1855.   $startsh
  1856. ! # $Header: makedir.SH,v 4.0 91/03/20 01:27:13 lwall Locked $
  1857.   # 
  1858.   # $Log:    makedir.SH,v $
  1859.   # Revision 4.0  91/03/20  01:27:13  lwall
  1860.   # 4.0 baseline.
  1861.   # 
  1862. --- 13,27 ----
  1863.   */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  1864.   esac
  1865.   echo "Extracting makedir (with variable substitutions)"
  1866. + rm -f makedir
  1867.   $spitshell >makedir <<!GROK!THIS!
  1868.   $startsh
  1869. ! # $RCSfile: makedir.SH,v $$Revision: 4.0.1.1 $$Date: 92/06/08 14:24:55 $
  1870.   # 
  1871.   # $Log:    makedir.SH,v $
  1872. + # Revision 4.0.1.1  92/06/08  14:24:55  lwall
  1873. + # patch20: SH files didn't work well with symbolic links
  1874. + # 
  1875.   # Revision 4.0  91/03/20  01:27:13  lwall
  1876.   # 4.0 baseline.
  1877.   # 
  1878.  
  1879. Index: atarist/usub/makefile.st
  1880. *** atarist/usub/makefile.st.old    Mon Jun  8 17:45:34 1992
  1881. --- atarist/usub/makefile.st    Mon Jun  8 17:45:35 1992
  1882. ***************
  1883. *** 0 ****
  1884. --- 1,17 ----
  1885. + CC = cgcc
  1886. + SRC = ..
  1887. + GLOBINCS = 
  1888. + LOCINCS = 
  1889. + LIBS = -lcurses  -lgdbm -lpml -lgnu
  1890. + cperl.ttp: $(SRC)/uperl.a usersub.o curses.o
  1891. +     $(CC) $(SRC)/uperl.a usersub.o curses.o $(LIBS) -o cperl.ttp
  1892. + usersub.o: usersub.c
  1893. +     $(CC) -c -I$(SRC) $(GLOBINCS) -O usersub.c
  1894. + curses.o: curses.c
  1895. +     $(CC) -c -I$(SRC) $(GLOBINCS) -O curses.c
  1896. + curses.c: acurses.mus
  1897. +     perl mus acurses.mus >curses.c
  1898.  
  1899. Index: hints/mc6000.sh
  1900. *** hints/mc6000.sh.old    Mon Jun  8 17:48:03 1992
  1901. --- hints/mc6000.sh    Mon Jun  8 17:48:04 1992
  1902. ***************
  1903. *** 0 ****
  1904. --- 1,5 ----
  1905. + # defaults for the masscomp (concurrent) 6000 series running RTU 5.0
  1906. + cppstdin=/lib/cpp
  1907. + cmd_cflags='optimize=""'
  1908. + tcmd_cflags='optimize=""'
  1909. + d_mymalloc=define
  1910.  
  1911. *** End of Patch 26 ***
  1912. exit 0 # Just in case...
  1913.