|
|
1.1 ! root 1: ! 2: Index: list.c ! 3: *** /tmp/,RCSt1a17078 Sun Feb 12 14:07:03 1989 ! 4: --- list.c Sun Feb 12 14:02:13 1989 ! 5: *************** ! 6: *** 1,6 ! 7: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 8: * ! 9: ! * $Revision: 1.1 $ ! 10: * ! 11: * list.c - List all files on an archive ! 12: * ! 13: ! 14: --- 1,6 ----- ! 15: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 16: * ! 17: ! * $Revision: 1.1 $ ! 18: * ! 19: * list.c - List all files on an archive ! 20: * ! 21: *************** ! 22: *** 27,33 ! 23: * ! 24: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 25: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 26: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 27: * ! 28: * $Log: patch2,v $ ! 29: # Revision 1.1 92/08/28 08:02:34 bin ! 30: # Initial revision ! 31: # ! 32: * Revision 1.1 88/12/23 18:02:14 mark ! 33: ! 34: --- 27,33 ----- ! 35: * ! 36: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 37: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 38: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 39: * ! 40: * $Log: patch2,v $ ! 41: # Revision 1.1 92/08/28 08:02:34 bin ! 42: # Initial revision ! 43: # ! 44: * Revision 1.2 89/02/12 10:04:43 mark ! 45: *************** ! 46: *** 30,35 ! 47: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 48: * ! 49: * $Log: patch2,v $ ! 50: # Revision 1.1 92/08/28 08:02:34 bin ! 51: # Initial revision ! 52: # ! 53: * Revision 1.1 88/12/23 18:02:14 mark ! 54: * Initial revision ! 55: * ! 56: ! 57: --- 30,38 ----- ! 58: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 59: * ! 60: * $Log: patch2,v $ ! 61: # Revision 1.1 92/08/28 08:02:34 bin ! 62: # Initial revision ! 63: # ! 64: + * Revision 1.2 89/02/12 10:04:43 mark ! 65: + * 1.2 release fixes ! 66: + * ! 67: * Revision 1.1 88/12/23 18:02:14 mark ! 68: * Initial revision ! 69: * ! 70: *************** ! 71: *** 36,42 ! 72: */ ! 73: ! 74: #ifndef lint ! 75: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 76: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 77: #endif /* ! lint */ ! 78: ! 79: ! 80: --- 39,45 ----- ! 81: */ ! 82: ! 83: #ifndef lint ! 84: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 85: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 86: #endif /* ! lint */ ! 87: ! 88: *************** ! 89: *** 384,390 ! 90: case S_IFLNK: /* This file is a symbolic link */ ! 91: i = readlink(name, symnam, PATH_MAX - 1); ! 92: if (i < 0) { /* Could not find symbolic link */ ! 93: ! warn("can't read symbolic link", syserr()); ! 94: } else { /* Found symbolic link filename */ ! 95: symnam[i] = '\0'; ! 96: fprintf(msgfile, "x %s symbolic link to %s\n", name, symnam); ! 97: ! 98: --- 387,393 ----- ! 99: case S_IFLNK: /* This file is a symbolic link */ ! 100: i = readlink(name, symnam, PATH_MAX - 1); ! 101: if (i < 0) { /* Could not find symbolic link */ ! 102: ! warn("can't read symbolic link", strerror()); ! 103: } else { /* Found symbolic link filename */ ! 104: symnam[i] = '\0'; ! 105: fprintf(msgfile, "x %s symbolic link to %s\n", name, symnam); ! 106: *************** ! 107: *** 395,401 ! 108: if ((asb->sb_nlink > 1) && (link = islink(name, asb))) { ! 109: fprintf(msgfile, "%s linked to %s\n", name, link->l_name); ! 110: } else { ! 111: ! fprintf(msgfile, "x %s, %d bytes, %d tape blocks\n", ! 112: name, asb->sb_size, ROUNDUP(asb->sb_size, ! 113: BLOCKSIZE) / BLOCKSIZE); ! 114: } ! 115: ! 116: --- 398,404 ----- ! 117: if ((asb->sb_nlink > 1) && (link = islink(name, asb))) { ! 118: fprintf(msgfile, "%s linked to %s\n", name, link->l_name); ! 119: } else { ! 120: ! fprintf(msgfile, "x %s, %ld bytes, %d tape blocks\n", ! 121: name, asb->sb_size, ROUNDUP(asb->sb_size, ! 122: BLOCKSIZE) / BLOCKSIZE); ! 123: } ! 124: *************** ! 125: *** 406,412 ! 126: case S_IFLNK: /* This file is a symbolic link */ ! 127: i = readlink(name, symnam, PATH_MAX - 1); ! 128: if (i < 0) { /* Could not find symbolic link */ ! 129: ! warn("can't read symbolic link", syserr()); ! 130: } else { /* Found symbolic link filename */ ! 131: symnam[i] = '\0'; ! 132: fprintf(msgfile, "a %s symbolic link to %s\n", name, symnam); ! 133: ! 134: --- 409,415 ----- ! 135: case S_IFLNK: /* This file is a symbolic link */ ! 136: i = readlink(name, symnam, PATH_MAX - 1); ! 137: if (i < 0) { /* Could not find symbolic link */ ! 138: ! warn("can't read symbolic link", strerror()); ! 139: } else { /* Found symbolic link filename */ ! 140: symnam[i] = '\0'; ! 141: fprintf(msgfile, "a %s symbolic link to %s\n", name, symnam); ! 142: *************** ! 143: *** 418,424 ! 144: if ((asb->sb_nlink > 1) && (link = islink(name, asb))) { ! 145: fprintf(msgfile, "link to %s\n", link->l_name); ! 146: } else { ! 147: ! fprintf(msgfile, "%d Blocks\n", ! 148: ROUNDUP(asb->sb_size, BLOCKSIZE) / BLOCKSIZE); ! 149: } ! 150: break; ! 151: ! 152: --- 421,427 ----- ! 153: if ((asb->sb_nlink > 1) && (link = islink(name, asb))) { ! 154: fprintf(msgfile, "link to %s\n", link->l_name); ! 155: } else { ! 156: ! fprintf(msgfile, "%ld Blocks\n", ! 157: ROUNDUP(asb->sb_size, BLOCKSIZE) / BLOCKSIZE); ! 158: } ! 159: break; ! 160: *************** ! 161: *** 439,445 ! 162: case S_IFLNK: /* This file is a symbolic link */ ! 163: i = readlink(name, symnam, PATH_MAX - 1); ! 164: if (i < 0) { /* Could not find symbolic link */ ! 165: ! warn("can't read symbolic link", syserr()); ! 166: } else { /* Found symbolic link filename */ ! 167: symnam[i] = '\0'; ! 168: fprintf(msgfile, " symbolic link to %s", name, symnam); ! 169: ! 170: --- 442,448 ----- ! 171: case S_IFLNK: /* This file is a symbolic link */ ! 172: i = readlink(name, symnam, PATH_MAX - 1); ! 173: if (i < 0) { /* Could not find symbolic link */ ! 174: ! warn("can't read symbolic link", strerror()); ! 175: } else { /* Found symbolic link filename */ ! 176: symnam[i] = '\0'; ! 177: fprintf(msgfile, " symbolic link to %s", symnam); ! 178: *************** ! 179: *** 442,448 ! 180: warn("can't read symbolic link", syserr()); ! 181: } else { /* Found symbolic link filename */ ! 182: symnam[i] = '\0'; ! 183: ! fprintf(msgfile, " symbolic link to %s", name, symnam); ! 184: } ! 185: break; ! 186: #endif ! 187: ! 188: --- 445,451 ----- ! 189: warn("can't read symbolic link", strerror()); ! 190: } else { /* Found symbolic link filename */ ! 191: symnam[i] = '\0'; ! 192: ! fprintf(msgfile, " symbolic link to %s", symnam); ! 193: } ! 194: break; ! 195: #endif ! 196: *************** ! 197: *** 454,460 ! 198: } ! 199: fputc('\n', msgfile); ! 200: } else { ! 201: ! fprintf(msgfile, "? %s %d blocks\n", name, ! 202: ROUNDUP(asb->sb_size, BLOCKSIZE) / BLOCKSIZE); ! 203: } ! 204: } ! 205: ! 206: --- 457,463 ----- ! 207: } ! 208: fputc('\n', msgfile); ! 209: } else { ! 210: ! fprintf(msgfile, "? %s %ld blocks\n", name, ! 211: ROUNDUP(asb->sb_size, BLOCKSIZE) / BLOCKSIZE); ! 212: } ! 213: } ! 214: *************** ! 215: *** 518,525 ! 216: fprintf(msgfile, "\t "); ! 217: } ! 218: fprintf(msgfile," %3s %2d %02d:%02d ", ! 219: ! monnames[atm->tm_mon], atm->tm_mday, ! 220: ! atm->tm_hour, atm->tm_min); ! 221: } ! 222: fprintf(msgfile, "%s", name); ! 223: if ((asb->sb_nlink > 1) && (from = islink(name, asb))) { ! 224: ! 225: --- 521,528 ----- ! 226: fprintf(msgfile, "\t "); ! 227: } ! 228: fprintf(msgfile," %3s %2d %02d:%02d ", ! 229: ! monnames[atm->tm_mon], atm->tm_mday, ! 230: ! atm->tm_hour, atm->tm_min); ! 231: } ! 232: fprintf(msgfile, "%s", name); ! 233: if ((asb->sb_nlink > 1) && (from = islink(name, asb))) { ! 234: *************** ! 235: *** 532,539 ! 236: #endif /* S_IFLNK */ ! 237: putc('\n', msgfile); ! 238: } ! 239: - ! 240: - ! 241: ! 242: ! 243: /* print_mode - fancy file mode display ! 244: ! 245: --- 535,540 ----- ! 246: #endif /* S_IFLNK */ ! 247: putc('\n', msgfile); ! 248: } ! 249: ! 250: ! 251: /* print_mode - fancy file mode display ! 252: Index: mem.c ! 253: *** /tmp/,RCSt1a17083 Sun Feb 12 14:07:14 1989 ! 254: --- mem.c Sun Feb 12 14:02:14 1989 ! 255: *************** ! 256: *** 1,6 ! 257: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 258: * ! 259: ! * $Revision: 1.1 $ ! 260: * ! 261: * mem.c - memory allocation and manipulation functions ! 262: * ! 263: ! 264: --- 1,6 ----- ! 265: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 266: * ! 267: ! * $Revision: 1.1 $ ! 268: * ! 269: * mem.c - memory allocation and manipulation functions ! 270: * ! 271: *************** ! 272: *** 28,34 ! 273: * ! 274: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 275: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 276: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 277: * ! 278: * $Log: patch2,v $ ! 279: # Revision 1.1 92/08/28 08:02:34 bin ! 280: # Initial revision ! 281: # ! 282: * Revision 1.1 88/12/23 18:02:17 mark ! 283: ! 284: --- 28,34 ----- ! 285: * ! 286: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 287: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 288: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 289: * ! 290: * $Log: patch2,v $ ! 291: # Revision 1.1 92/08/28 08:02:34 bin ! 292: # Initial revision ! 293: # ! 294: * Revision 1.2 89/02/12 10:04:53 mark ! 295: *************** ! 296: *** 31,36 ! 297: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 298: * ! 299: * $Log: patch2,v $ ! 300: # Revision 1.1 92/08/28 08:02:34 bin ! 301: # Initial revision ! 302: # ! 303: * Revision 1.1 88/12/23 18:02:17 mark ! 304: * Initial revision ! 305: * ! 306: ! 307: --- 31,39 ----- ! 308: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 309: * ! 310: * $Log: patch2,v $ ! 311: # Revision 1.1 92/08/28 08:02:34 bin ! 312: # Initial revision ! 313: # ! 314: + * Revision 1.2 89/02/12 10:04:53 mark ! 315: + * 1.2 release fixes ! 316: + * ! 317: * Revision 1.1 88/12/23 18:02:17 mark ! 318: * Initial revision ! 319: * ! 320: *************** ! 321: *** 37,43 ! 322: */ ! 323: ! 324: #ifndef lint ! 325: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 326: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 327: #endif /* ! lint */ ! 328: ! 329: ! 330: --- 40,46 ----- ! 331: */ ! 332: ! 333: #ifndef lint ! 334: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 335: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 336: #endif /* ! lint */ ! 337: ! 338: *************** ! 339: *** 65,71 ! 340: * RETURNS ! 341: * ! 342: * Normally returns the pointer to the newly allocated memory. If ! 343: ! * an error occurss, NULL is returned, and an error message is ! 344: * printed. ! 345: * ! 346: * ERRORS ! 347: ! 348: --- 68,74 ----- ! 349: * RETURNS ! 350: * ! 351: * Normally returns the pointer to the newly allocated memory. If ! 352: ! * an error occurs, NULL is returned, and an error message is ! 353: * printed. ! 354: * ! 355: * ERRORS ! 356: *************** ! 357: *** 87,93 ! 358: char *mem; ! 359: static short outofmem = 0; ! 360: ! 361: ! if ((mem = (char *)malloc(len)) == NULL && !outofmem) { ! 362: outofmem++; ! 363: warn("mem_get()", "Out of memory"); ! 364: } ! 365: ! 366: --- 90,96 ----- ! 367: char *mem; ! 368: static short outofmem = 0; ! 369: ! 370: ! if ((mem = (char *)malloc(len)) == (char *)NULL && !outofmem) { ! 371: outofmem++; ! 372: warn("mem_get()", "Out of memory"); ! 373: } ! 374: Index: namelist.c ! 375: *** /tmp/,RCSt1a19493 Mon Feb 13 09:15:28 1989 ! 376: --- namelist.c Mon Feb 13 09:14:57 1989 ! 377: *************** ! 378: *** 1,6 ! 379: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 380: * ! 381: ! * $Revision: 1.1 $ ! 382: * ! 383: * namelist.c - track filenames given as arguments to tar/cpio/pax ! 384: * ! 385: ! 386: --- 1,6 ----- ! 387: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 388: * ! 389: ! * $Revision: 1.1 $ ! 390: * ! 391: * namelist.c - track filenames given as arguments to tar/cpio/pax ! 392: * ! 393: *************** ! 394: *** 23,29 ! 395: * provided that the above copyright notice is duplicated in all such ! 396: * forms and that any documentation, advertising materials, and other ! 397: * materials related to such distribution and use acknowledge that the ! 398: ! * software was developed * by Mark H. Colburn and sponsored by The ! 399: * USENIX Association. ! 400: * ! 401: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 402: ! 403: --- 23,29 ----- ! 404: * provided that the above copyright notice is duplicated in all such ! 405: * forms and that any documentation, advertising materials, and other ! 406: * materials related to such distribution and use acknowledge that the ! 407: ! * software was developed by Mark H. Colburn and sponsored by The ! 408: * USENIX Association. ! 409: * ! 410: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 411: *************** ! 412: *** 28,34 ! 413: * ! 414: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 415: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 416: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 417: * ! 418: * $Log: patch2,v $ ! 419: # Revision 1.1 92/08/28 08:02:34 bin ! 420: # Initial revision ! 421: # ! 422: * Revision 1.1 88/12/23 18:02:17 mark ! 423: ! 424: --- 28,34 ----- ! 425: * ! 426: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 427: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 428: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 429: * ! 430: * $Log: patch2,v $ ! 431: # Revision 1.1 92/08/28 08:02:34 bin ! 432: # Initial revision ! 433: # ! 434: * Revision 1.6 89/02/13 09:14:48 mark ! 435: *************** ! 436: *** 31,36 ! 437: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 438: * ! 439: * $Log: patch2,v $ ! 440: # Revision 1.1 92/08/28 08:02:34 bin ! 441: # Initial revision ! 442: # ! 443: * Revision 1.1 88/12/23 18:02:17 mark ! 444: * Initial revision ! 445: * ! 446: ! 447: --- 31,51 ----- ! 448: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 449: * ! 450: * $Log: patch2,v $ ! 451: # Revision 1.1 92/08/28 08:02:34 bin ! 452: # Initial revision ! 453: # ! 454: + * Revision 1.6 89/02/13 09:14:48 mark ! 455: + * Fixed problem with directory errors ! 456: + * ! 457: + * Revision 1.5 89/02/12 12:14:00 mark ! 458: + * Fixed misspellings ! 459: + * ! 460: + * Revision 1.4 89/02/12 11:25:19 mark ! 461: + * Modifications to compile and link cleanly under USG ! 462: + * ! 463: + * Revision 1.3 89/02/12 10:40:23 mark ! 464: + * Fixed casting problems ! 465: + * ! 466: + * Revision 1.2 89/02/12 10:04:57 mark ! 467: + * 1.2 release fixes ! 468: + * ! 469: * Revision 1.1 88/12/23 18:02:17 mark ! 470: * Initial revision ! 471: * ! 472: *************** ! 473: *** 37,43 ! 474: */ ! 475: ! 476: #ifndef lint ! 477: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 478: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 479: #endif /* ! lint */ ! 480: ! 481: ! 482: --- 52,58 ----- ! 483: */ ! 484: ! 485: #ifndef lint ! 486: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 487: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 488: #endif /* ! lint */ ! 489: ! 490: *************** ! 491: *** 68,73 ! 492: }; ! 493: ! 494: ! 495: /* Function Prototypes */ ! 496: ! 497: #ifndef __STDC__ ! 498: ! 499: --- 83,93 ----- ! 500: }; ! 501: ! 502: ! 503: + /* Static Variables */ ! 504: + ! 505: + static struct dirinfo *stack_head = (struct dirinfo *)NULL; ! 506: + ! 507: + ! 508: /* Function Prototypes */ ! 509: ! 510: #ifndef __STDC__ ! 511: *************** ! 512: *** 123,129 ! 513: if (!p) { ! 514: fatal("cannot allocate memory for namelist entry\n"); ! 515: } ! 516: ! p->next = (struct nm_list *) NULL; ! 517: p->length = i; ! 518: strncpy(p->name, name, i); ! 519: p->name[i] = '\0'; /* Null term */ ! 520: ! 521: --- 143,149 ----- ! 522: if (!p) { ! 523: fatal("cannot allocate memory for namelist entry\n"); ! 524: } ! 525: ! p->next = (struct nm_list *)NULL; ! 526: p->length = i; ! 527: strncpy(p->name, name, i); ! 528: p->name[i] = '\0'; /* Null term */ ! 529: *************** ! 530: *** 231,237 ! 531: for (nlp = namelist; nlp != 0; nlp = nlp->next) { ! 532: if (!nlp->found) { ! 533: fprintf(stderr, "%s: %s not found in archive\n", ! 534: ! myname, nlp->name); ! 535: } ! 536: free(nlp); ! 537: } ! 538: ! 539: --- 251,257 ----- ! 540: for (nlp = namelist; nlp != 0; nlp = nlp->next) { ! 541: if (!nlp->found) { ! 542: fprintf(stderr, "%s: %s not found in archive\n", ! 543: ! myname, nlp->name); ! 544: } ! 545: free(nlp); ! 546: } ! 547: *************** ! 548: *** 235,242 ! 549: } ! 550: free(nlp); ! 551: } ! 552: ! namelist = (struct nm_list *) NULL; ! 553: ! namelast = (struct nm_list *) NULL; ! 554: } ! 555: ! 556: ! 557: ! 558: --- 255,262 ----- ! 559: } ! 560: free(nlp); ! 561: } ! 562: ! namelist = (struct nm_list *)NULL; ! 563: ! namelast = (struct nm_list *)NULL; ! 564: } ! 565: ! 566: ! 567: *************** ! 568: *** 326,332 ! 569: } ! 570: } else { ! 571: if (in_subdir) { ! 572: ! if ((d = readdir(dirp)) != NULL) { ! 573: /* Skip . and .. */ ! 574: if (strcmp(d->d_name, ".") == 0 || ! 575: strcmp(d->d_name, "..") == 0) { ! 576: ! 577: --- 346,352 ----- ! 578: } ! 579: } else { ! 580: if (in_subdir) { ! 581: ! if ((d = readdir(dirp)) != (struct dirent *)NULL) { ! 582: /* Skip . and .. */ ! 583: if (strcmp(d->d_name, ".") == 0 || ! 584: strcmp(d->d_name, "..") == 0) { ! 585: *************** ! 586: *** 345,351 ! 587: curr_dir = popdir(); ! 588: if (in_subdir) { ! 589: errno = 0; ! 590: ! if ((dirp = opendir(curr_dir->dirname)) == NULL) { ! 591: warn(curr_dir->dirname, "error opening directory (1)"); ! 592: in_subdir--; ! 593: } ! 594: ! 595: --- 365,371 ----- ! 596: curr_dir = popdir(); ! 597: if (in_subdir) { ! 598: errno = 0; ! 599: ! if ((dirp=opendir(curr_dir->dirname)) == (DIR *)NULL) { ! 600: warn(curr_dir->dirname, "error opening directory (1)"); ! 601: in_subdir--; ! 602: } ! 603: *************** ! 604: *** 360,366 ! 605: } ! 606: } ! 607: if ((err = LSTAT(name, statbuf)) < 0) { ! 608: ! warn(name, syserr()); ! 609: continue; ! 610: } ! 611: if (!names_from_stdin && (statbuf->sb_mode & S_IFMT) == S_IFDIR) { ! 612: ! 613: --- 380,386 ----- ! 614: } ! 615: } ! 616: if ((err = LSTAT(name, statbuf)) < 0) { ! 617: ! warn(name, strerror()); ! 618: continue; ! 619: } ! 620: if (!names_from_stdin && (statbuf->sb_mode & S_IFMT) == S_IFDIR) { ! 621: *************** ! 622: *** 367,373 ! 623: if (in_subdir) { ! 624: curr_dir->where = telldir(dirp); ! 625: pushdir(curr_dir); ! 626: ! close(dirp); ! 627: } ! 628: in_subdir++; ! 629: ! 630: ! 631: --- 387,393 ----- ! 632: if (in_subdir) { ! 633: curr_dir->where = telldir(dirp); ! 634: pushdir(curr_dir); ! 635: ! closedir(dirp); ! 636: } ! 637: in_subdir++; ! 638: ! 639: *************** ! 640: *** 372,379 ! 641: in_subdir++; ! 642: ! 643: /* Build new prototype name */ ! 644: ! if ((curr_dir = (struct dirinfo *) ! 645: ! mem_get(sizeof(struct dirinfo))) == NULL) { ! 646: exit(2); ! 647: } ! 648: strcpy(curr_dir->dirname, name); ! 649: ! 650: --- 392,399 ----- ! 651: in_subdir++; ! 652: ! 653: /* Build new prototype name */ ! 654: ! if ((curr_dir = (struct dirinfo *) mem_get(sizeof(struct dirinfo))) ! 655: ! == (struct dirinfo *)NULL) { ! 656: exit(2); ! 657: } ! 658: strcpy(curr_dir->dirname, name); ! 659: *************** ! 660: *** 383,393 ! 661: } ! 662: curr_dir->dirname[len++] = '/'; /* Now add exactly one back */ ! 663: curr_dir->dirname[len] = '\0';/* Make sure null-terminated */ ! 664: ! ! 665: ! errno = 0; ! 666: ! if ((dirp = opendir(curr_dir->dirname)) == NULL) { ! 667: ! warn(curr_dir->dirname, "error opening directory (2)"); ! 668: ! } ! 669: } ! 670: } while (err < 0); ! 671: return (0); ! 672: ! 673: --- 403,424 ----- ! 674: } ! 675: curr_dir->dirname[len++] = '/'; /* Now add exactly one back */ ! 676: curr_dir->dirname[len] = '\0';/* Make sure null-terminated */ ! 677: ! curr_dir->where = 0; ! 678: ! ! 679: ! errno = 0; ! 680: ! do { ! 681: ! if ((dirp = opendir(curr_dir->dirname)) == (DIR *)NULL) { ! 682: ! warn(curr_dir->dirname, "error opening directory (2)"); ! 683: ! if (in_subdir > 1) { ! 684: ! curr_dir = popdir(); ! 685: ! } ! 686: ! in_subdir--; ! 687: ! err = -1; ! 688: ! continue; ! 689: ! } else { ! 690: ! seekdir(dirp, curr_dir->where); ! 691: ! } ! 692: ! } while (in_subdir && (! dirp)); ! 693: } ! 694: } while (err < 0); ! 695: return (0); ! 696: *************** ! 697: *** 422,430 ! 698: } ! 699: ! 700: ! 701: - static struct dirinfo *stack_head = NULL; ! 702: - ! 703: - ! 704: /* pushdir - pushes a directory name on the directory stack ! 705: * ! 706: * DESCRIPTION ! 707: ! 708: --- 453,458 ----- ! 709: } ! 710: ! 711: ! 712: /* pushdir - pushes a directory name on the directory stack ! 713: * ! 714: * DESCRIPTION ! 715: *************** ! 716: *** 449,455 ! 717: ! 718: #endif ! 719: { ! 720: ! if (stack_head == NULL) { ! 721: stack_head = info; ! 722: stack_head->next = NULL; ! 723: } else { ! 724: ! 725: --- 477,483 ----- ! 726: ! 727: #endif ! 728: { ! 729: ! if (stack_head == (struct dirinfo *)NULL) { ! 730: stack_head = info; ! 731: stack_head->next = (struct dirinfo *)NULL; ! 732: } else { ! 733: *************** ! 734: *** 451,457 ! 735: { ! 736: if (stack_head == NULL) { ! 737: stack_head = info; ! 738: ! stack_head->next = NULL; ! 739: } else { ! 740: info->next = stack_head; ! 741: stack_head = info; ! 742: ! 743: --- 479,485 ----- ! 744: { ! 745: if (stack_head == (struct dirinfo *)NULL) { ! 746: stack_head = info; ! 747: ! stack_head->next = (struct dirinfo *)NULL; ! 748: } else { ! 749: info->next = stack_head; ! 750: stack_head = info; ! 751: *************** ! 752: *** 485,492 ! 753: { ! 754: struct dirinfo *tmp; ! 755: ! 756: ! if (stack_head == NULL) { ! 757: ! return(NULL); ! 758: } else { ! 759: tmp = stack_head; ! 760: stack_head = stack_head->next; ! 761: ! 762: --- 513,520 ----- ! 763: { ! 764: struct dirinfo *tmp; ! 765: ! 766: ! if (stack_head == (struct dirinfo *)NULL) { ! 767: ! return((struct dirinfo *)NULL); ! 768: } else { ! 769: tmp = stack_head; ! 770: stack_head = stack_head->next; ! 771: Index: names.c ! 772: *** /tmp/,RCSt1a17093 Sun Feb 12 14:07:34 1989 ! 773: --- names.c Sun Feb 12 14:02:17 1989 ! 774: *************** ! 775: *** 1,6 ! 776: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 777: * ! 778: ! * $Revision: 1.1 $ ! 779: * ! 780: * names.c - Look up user and/or group names. ! 781: * ! 782: ! 783: --- 1,6 ----- ! 784: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 785: * ! 786: ! * $Revision: 1.1 $ ! 787: * ! 788: * names.c - Look up user and/or group names. ! 789: * ! 790: *************** ! 791: *** 27,33 ! 792: * ! 793: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 794: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 795: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 796: * ! 797: * $Log: patch2,v $ ! 798: # Revision 1.1 92/08/28 08:02:34 bin ! 799: # Initial revision ! 800: # ! 801: * Revision 1.1 88/12/23 18:02:19 mark ! 802: ! 803: --- 27,33 ----- ! 804: * ! 805: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 806: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 807: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 808: * ! 809: * $Log: patch2,v $ ! 810: # Revision 1.1 92/08/28 08:02:34 bin ! 811: # Initial revision ! 812: # ! 813: * Revision 1.2 89/02/12 10:05:05 mark ! 814: *************** ! 815: *** 30,35 ! 816: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 817: * ! 818: * $Log: patch2,v $ ! 819: # Revision 1.1 92/08/28 08:02:34 bin ! 820: # Initial revision ! 821: # ! 822: * Revision 1.1 88/12/23 18:02:19 mark ! 823: * Initial revision ! 824: * ! 825: ! 826: --- 30,38 ----- ! 827: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 828: * ! 829: * $Log: patch2,v $ ! 830: # Revision 1.1 92/08/28 08:02:34 bin ! 831: # Initial revision ! 832: # ! 833: + * Revision 1.2 89/02/12 10:05:05 mark ! 834: + * 1.2 release fixes ! 835: + * ! 836: * Revision 1.1 88/12/23 18:02:19 mark ! 837: * Initial revision ! 838: * ! 839: *************** ! 840: *** 36,42 ! 841: */ ! 842: ! 843: #ifndef lint ! 844: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 845: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 846: #endif /* ! lint */ ! 847: ! 848: ! 849: --- 39,45 ----- ! 850: */ ! 851: ! 852: #ifndef lint ! 853: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 854: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 855: #endif /* ! lint */ ! 856: ! 857: Index: pass.c ! 858: *** /tmp/,RCSt1a17098 Sun Feb 12 14:07:40 1989 ! 859: --- pass.c Sun Feb 12 14:02:19 1989 ! 860: *************** ! 861: *** 1,6 ! 862: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 863: * ! 864: ! * $Revision: 1.1 $ ! 865: * ! 866: * pass.c - handle the pass option of cpio ! 867: * ! 868: ! 869: --- 1,6 ----- ! 870: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 871: * ! 872: ! * $Revision: 1.1 $ ! 873: * ! 874: * pass.c - handle the pass option of cpio ! 875: * ! 876: *************** ! 877: *** 27,33 ! 878: * ! 879: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 880: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 881: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 882: * ! 883: * $Log: patch2,v $ ! 884: # Revision 1.1 92/08/28 08:02:34 bin ! 885: # Initial revision ! 886: # ! 887: * Revision 1.1 88/12/23 18:02:20 mark ! 888: ! 889: --- 27,33 ----- ! 890: * ! 891: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 892: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 893: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 894: * ! 895: * $Log: patch2,v $ ! 896: # Revision 1.1 92/08/28 08:02:34 bin ! 897: # Initial revision ! 898: # ! 899: * Revision 1.3 89/02/12 10:29:51 mark ! 900: *************** ! 901: *** 30,35 ! 902: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 903: * ! 904: * $Log: patch2,v $ ! 905: # Revision 1.1 92/08/28 08:02:34 bin ! 906: # Initial revision ! 907: # ! 908: * Revision 1.1 88/12/23 18:02:20 mark ! 909: * Initial revision ! 910: * ! 911: ! 912: --- 30,41 ----- ! 913: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 914: * ! 915: * $Log: patch2,v $ ! 916: # Revision 1.1 92/08/28 08:02:34 bin ! 917: # Initial revision ! 918: # ! 919: + * Revision 1.3 89/02/12 10:29:51 mark ! 920: + * Fixed misspelling of Replstr ! 921: + * ! 922: + * Revision 1.2 89/02/12 10:05:09 mark ! 923: + * 1.2 release fixes ! 924: + * ! 925: * Revision 1.1 88/12/23 18:02:20 mark ! 926: * Initial revision ! 927: * ! 928: *************** ! 929: *** 36,42 ! 930: */ ! 931: ! 932: #ifndef lint ! 933: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 934: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 935: #endif /* ! lint */ ! 936: ! 937: ! 938: --- 42,48 ----- ! 939: */ ! 940: ! 941: #ifndef lint ! 942: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 943: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 944: #endif /* ! lint */ ! 945: ! 946: *************** ! 947: *** 74,80 ! 948: int fd; ! 949: Stat sb; ! 950: ! 951: ! while (name_next(name, &sb) >= 0 && (fd = openi(name, &sb)) >= 0) { ! 952: ! 953: if (rplhead != NULL) { ! 954: rpl_name(name); ! 955: ! 956: --- 80,86 ----- ! 957: int fd; ! 958: Stat sb; ! 959: ! 960: ! while (name_next(name, &sb) >= 0 && (fd = openin(name, &sb)) >= 0) { ! 961: ! 962: if (rplhead != (Replstr *)NULL) { ! 963: rpl_name(name); ! 964: *************** ! 965: *** 76,82 ! 966: ! 967: while (name_next(name, &sb) >= 0 && (fd = openi(name, &sb)) >= 0) { ! 968: ! 969: ! if (rplhead != NULL) { ! 970: rpl_name(name); ! 971: } ! 972: if (get_disposition("pass", name) || get_newname(name, sizeof(name))) { ! 973: ! 974: --- 82,88 ----- ! 975: ! 976: while (name_next(name, &sb) >= 0 && (fd = openin(name, &sb)) >= 0) { ! 977: ! 978: ! if (rplhead != (Replstr *)NULL) { ! 979: rpl_name(name); ! 980: } ! 981: if (get_disposition("pass", name) || get_newname(name, sizeof(name))) { ! 982: *************** ! 983: *** 139,147 ! 984: return (-1); ! 985: } ! 986: if (asb->sb_nlink > 1) { ! 987: - if (f_link && islink(from, asb) == (Link *) NULL) { ! 988: - linkto(from, asb); ! 989: - } ! 990: linkto(to, asb); ! 991: } ! 992: if ((ofd = openo(to, asb, islink(to, asb), 1)) < 0) { ! 993: ! 994: --- 145,150 ----- ! 995: return (-1); ! 996: } ! 997: if (asb->sb_nlink > 1) { ! 998: linkto(to, asb); ! 999: } ! 1000: if (f_link && islink(from, asb) == (Link *)NULL) { ! 1001: *************** ! 1002: *** 144,150 ! 1003: } ! 1004: linkto(to, asb); ! 1005: } ! 1006: ! if ((ofd = openo(to, asb, islink(to, asb), 1)) < 0) { ! 1007: return (-1); ! 1008: } ! 1009: if (ofd > 0) { ! 1010: ! 1011: --- 147,156 ----- ! 1012: if (asb->sb_nlink > 1) { ! 1013: linkto(to, asb); ! 1014: } ! 1015: ! if (f_link && islink(from, asb) == (Link *)NULL) { ! 1016: ! linkto(from, asb); ! 1017: ! } ! 1018: ! if ((ofd = openout(to, asb, islink(to, asb), 1)) < 0) { ! 1019: return (-1); ! 1020: } ! 1021: if (ofd > 0) { ! 1022: *************** ! 1023: *** 151,157 ! 1024: passdata(from, ifd, to, ofd); ! 1025: } ! 1026: tstamp[0] = asb->sb_atime; ! 1027: ! tstamp[1] = f_modification_time ? asb->sb_mtime : time((time_t *) 0); ! 1028: utime(to, tstamp); ! 1029: return (ifd); ! 1030: } ! 1031: ! 1032: --- 157,163 ----- ! 1033: passdata(from, ifd, to, ofd); ! 1034: } ! 1035: tstamp[0] = asb->sb_atime; ! 1036: ! tstamp[1] = f_mtime ? asb->sb_mtime : time((time_t *) 0); ! 1037: utime(to, tstamp); ! 1038: return (ifd); ! 1039: } ! 1040: Index: pathname.c ! 1041: *** /tmp/,RCSt1a17103 Sun Feb 12 14:07:46 1989 ! 1042: --- pathname.c Sun Feb 12 14:02:21 1989 ! 1043: *************** ! 1044: *** 1,6 ! 1045: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 1046: * ! 1047: ! * $Revision: 1.1 $ ! 1048: * ! 1049: * pathname.c - directory/pathname support functions ! 1050: * ! 1051: ! 1052: --- 1,6 ----- ! 1053: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 1054: * ! 1055: ! * $Revision: 1.1 $ ! 1056: * ! 1057: * pathname.c - directory/pathname support functions ! 1058: * ! 1059: *************** ! 1060: *** 26,32 ! 1061: * ! 1062: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1063: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1064: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1065: * ! 1066: * $Log: patch2,v $ ! 1067: # Revision 1.1 92/08/28 08:02:34 bin ! 1068: # Initial revision ! 1069: # ! 1070: * Revision 1.1 88/12/23 18:02:21 mark ! 1071: ! 1072: --- 26,32 ----- ! 1073: * ! 1074: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1075: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1076: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1077: * ! 1078: * $Log: patch2,v $ ! 1079: # Revision 1.1 92/08/28 08:02:34 bin ! 1080: # Initial revision ! 1081: # ! 1082: * Revision 1.2 89/02/12 10:05:13 mark ! 1083: *************** ! 1084: *** 29,34 ! 1085: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1086: * ! 1087: * $Log: patch2,v $ ! 1088: # Revision 1.1 92/08/28 08:02:34 bin ! 1089: # Initial revision ! 1090: # ! 1091: * Revision 1.1 88/12/23 18:02:21 mark ! 1092: * Initial revision ! 1093: * ! 1094: ! 1095: --- 29,37 ----- ! 1096: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1097: * ! 1098: * $Log: patch2,v $ ! 1099: # Revision 1.1 92/08/28 08:02:34 bin ! 1100: # Initial revision ! 1101: # ! 1102: + * Revision 1.2 89/02/12 10:05:13 mark ! 1103: + * 1.2 release fixes ! 1104: + * ! 1105: * Revision 1.1 88/12/23 18:02:21 mark ! 1106: * Initial revision ! 1107: * ! 1108: *************** ! 1109: *** 35,41 ! 1110: */ ! 1111: ! 1112: #ifndef lint ! 1113: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 1114: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 1115: #endif /* ! lint */ ! 1116: ! 1117: ! 1118: --- 38,44 ----- ! 1119: */ ! 1120: ! 1121: #ifndef lint ! 1122: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 1123: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 1124: #endif /* ! lint */ ! 1125: ! 1126: *************** ! 1127: *** 51,57 ! 1128: * ! 1129: * Dirneed checks to see if a directory of the name pointed to by name ! 1130: * exists. If the directory does exist, then dirneed returns 0. If ! 1131: ! * the directory does not exist and the f_create_dirs flag is set, ! 1132: * then dirneed will create the needed directory, recursively creating ! 1133: * any needed intermediate directory. ! 1134: * ! 1135: ! 1136: --- 54,60 ----- ! 1137: * ! 1138: * Dirneed checks to see if a directory of the name pointed to by name ! 1139: * exists. If the directory does exist, then dirneed returns 0. If ! 1140: ! * the directory does not exist and the f_dir_create flag is set, ! 1141: * then dirneed will create the needed directory, recursively creating ! 1142: * any needed intermediate directory. ! 1143: * ! 1144: *************** ! 1145: *** 55,61 ! 1146: * then dirneed will create the needed directory, recursively creating ! 1147: * any needed intermediate directory. ! 1148: * ! 1149: ! * If f_create_dirs is not set, then no directories will be created ! 1150: * and a value of -1 will be returned if the directory does not ! 1151: * exist. ! 1152: * ! 1153: ! 1154: --- 58,64 ----- ! 1155: * then dirneed will create the needed directory, recursively creating ! 1156: * any needed intermediate directory. ! 1157: * ! 1158: ! * If f_dir_create is not set, then no directories will be created ! 1159: * and a value of -1 will be returned if the directory does not ! 1160: * exist. ! 1161: * ! 1162: *************** ! 1163: *** 66,72 ! 1164: * RETURNS ! 1165: * ! 1166: * Returns a 0 if the creation of the directory succeeded or if the ! 1167: ! * directory already existed. If the f_create_dirs flag was not set ! 1168: * and the named directory does not exist, or the directory creation ! 1169: * failed, a -1 will be returned to the calling routine. ! 1170: */ ! 1171: ! 1172: --- 69,75 ----- ! 1173: * RETURNS ! 1174: * ! 1175: * Returns a 0 if the creation of the directory succeeded or if the ! 1176: ! * directory already existed. If the f_dir_create flag was not set ! 1177: * and the named directory does not exist, or the directory creation ! 1178: * failed, a -1 will be returned to the calling routine. ! 1179: */ ! 1180: *************** ! 1181: *** 87,93 ! 1182: int ok; ! 1183: static Stat sb; ! 1184: ! 1185: ! last = NULL; ! 1186: for (cp = name; *cp;) { ! 1187: if (*cp++ == '/') { ! 1188: last = cp; ! 1189: ! 1190: --- 90,96 ----- ! 1191: int ok; ! 1192: static Stat sb; ! 1193: ! 1194: ! last = (char *)NULL; ! 1195: for (cp = name; *cp;) { ! 1196: if (*cp++ == '/') { ! 1197: last = cp; ! 1198: *************** ! 1199: *** 93,99 ! 1200: last = cp; ! 1201: } ! 1202: } ! 1203: ! if (last == NULL) { ! 1204: return (STAT(".", &sb)); ! 1205: } ! 1206: *--last = '\0'; ! 1207: ! 1208: --- 96,102 ----- ! 1209: last = cp; ! 1210: } ! 1211: } ! 1212: ! if (last == (char *)NULL) { ! 1213: return (STAT(".", &sb)); ! 1214: } ! 1215: *--last = '\0'; ! 1216: *************** ! 1217: *** 99,105 ! 1218: *--last = '\0'; ! 1219: ok = STAT(*name ? name : ".", &sb) == 0 ! 1220: ? ((sb.sb_mode & S_IFMT) == S_IFDIR) ! 1221: ! : (f_create_dirs && dirneed(name) == 0 && dirmake(name, &sb) == 0); ! 1222: *last = '/'; ! 1223: return (ok ? 0 : -1); ! 1224: } ! 1225: ! 1226: --- 102,108 ----- ! 1227: *--last = '\0'; ! 1228: ok = STAT(*name ? name : ".", &sb) == 0 ! 1229: ? ((sb.sb_mode & S_IFMT) == S_IFDIR) ! 1230: ! : (f_dir_create && dirneed(name) == 0 && dirmake(name, &sb) == 0); ! 1231: *last = '/'; ! 1232: return (ok ? 0 : -1); ! 1233: } ! 1234: *************** ! 1235: *** 176,182 ! 1236: if (idx == 0) { ! 1237: element[idx++] = absolute ? "" : "."; ! 1238: } ! 1239: ! element[idx] = NULL; ! 1240: name = begin; ! 1241: if (absolute) { ! 1242: *name++ = '/'; ! 1243: ! 1244: --- 179,185 ----- ! 1245: if (idx == 0) { ! 1246: element[idx++] = absolute ? "" : "."; ! 1247: } ! 1248: ! element[idx] = (char *)NULL; ! 1249: name = begin; ! 1250: if (absolute) { ! 1251: *name++ = '/'; ! 1252: Index: pax.1 ! 1253: *** /tmp/,RCSt1a17108 Sun Feb 12 14:07:54 1989 ! 1254: --- pax.1 Sun Feb 12 14:02:22 1989 ! 1255: *************** ! 1256: *** 1,4 ! 1257: ! .\" $Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $ ! 1258: .TH PAX 1 "USENIX Association" "" ! 1259: .SH NAME ! 1260: pax \- portable archive exchange ! 1261: ! 1262: --- 1,4 ----- ! 1263: ! .\" $Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $ ! 1264: .TH PAX 1 "USENIX Association" "" ! 1265: .SH NAME ! 1266: pax \- portable archive exchange ! 1267: *************** ! 1268: *** 213,218 ! 1269: suffix multiplies ! 1270: .I blocking ! 1271: by 1048576 (1 megabyte). ! 1272: If not specified, ! 1273: .I blocking ! 1274: is automatically determined on input and is ignored for ! 1275: ! 1276: --- 213,220 ----- ! 1277: suffix multiplies ! 1278: .I blocking ! 1279: by 1048576 (1 megabyte). ! 1280: + For machines with 16-bit int's (VAXen, XENIX-286, etc.), ! 1281: + the maximum buffer size is 32k-1. ! 1282: If not specified, ! 1283: .I blocking ! 1284: is automatically determined on input and is ignored for ! 1285: *************** ! 1286: *** 219,225 ! 1287: .B \-rw. ! 1288: .TP 1i ! 1289: .B \-c ! 1290: ! Complement the match sense of the the ! 1291: .I pattern ! 1292: operands. ! 1293: .TP 1i ! 1294: ! 1295: --- 221,227 ----- ! 1296: .B \-rw. ! 1297: .TP 1i ! 1298: .B \-c ! 1299: ! Complement the match sense of the ! 1300: .I pattern ! 1301: operands. ! 1302: .TP 1i ! 1303: *************** ! 1304: *** 352,358 ! 1305: .B \-r ! 1306: option is used. ! 1307: The supported formats are: ! 1308: ! .TP 1i ! 1309: .I cpio ! 1310: The extended ! 1311: .I CPIO ! 1312: ! 1313: --- 354,361 ----- ! 1314: .B \-r ! 1315: option is used. ! 1316: The supported formats are: ! 1317: ! .RS 1i ! 1318: ! .TP 0.75i ! 1319: .I cpio ! 1320: The extended ! 1321: .I CPIO ! 1322: *************** ! 1323: *** 359,365 ! 1324: interchange format specified in ! 1325: .B "Extended CPIO Format" in ! 1326: .I "IEEE Std. 1003.1-1988." ! 1327: ! .TP 1i ! 1328: .I ustar ! 1329: The extended ! 1330: .I TAR ! 1331: ! 1332: --- 362,368 ----- ! 1333: interchange format specified in ! 1334: .B "Extended CPIO Format" in ! 1335: .I "IEEE Std. 1003.1-1988." ! 1336: ! .TP 0.75i ! 1337: .I ustar ! 1338: The extended ! 1339: .I TAR ! 1340: *************** ! 1341: *** 540,545 ! 1342: format archives, link counts are listed as zero since the ! 1343: .I ustar ! 1344: archive format does not keep link count information. ! 1345: .SH COPYRIGHT ! 1346: Copyright (c) 1989 Mark H. Colburn. ! 1347: .br ! 1348: ! 1349: --- 543,553 ----- ! 1350: format archives, link counts are listed as zero since the ! 1351: .I ustar ! 1352: archive format does not keep link count information. ! 1353: + .PP ! 1354: + On 16 bit architectures, the largest buffer size is 32k-1. ! 1355: + This is due, in part, to using integers in the buffer allocation schemes, ! 1356: + however, on many of these machines, it is not possible to allocate blocks ! 1357: + of memory larger than 32k. ! 1358: .SH COPYRIGHT ! 1359: Copyright (c) 1989 Mark H. Colburn. ! 1360: .br ! 1361: *************** ! 1362: *** 554,560 ! 1363: .PP ! 1364: THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1365: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1366: ! WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1367: .SH AUTHOR ! 1368: Mark H. Colburn ! 1369: .br ! 1370: ! 1371: --- 562,568 ----- ! 1372: .PP ! 1373: THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1374: IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1375: ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1376: .SH AUTHOR ! 1377: Mark H. Colburn ! 1378: .br ! 1379: *************** ! 1380: *** 558,564 ! 1381: .SH AUTHOR ! 1382: Mark H. Colburn ! 1383: .br ! 1384: ! NAPS International ! 1385: .br ! 1386: 117 Mackubin Street, Suite 1 ! 1387: .br ! 1388: ! 1389: --- 566,572 ----- ! 1390: .SH AUTHOR ! 1391: Mark H. Colburn ! 1392: .br ! 1393: ! Minnetech Consulting, Inc. ! 1394: .br ! 1395: 117 Mackubin Street, Suite 1 ! 1396: .br ! 1397: Index: pax.c ! 1398: *** /tmp/,RCSt1a17113 Sun Feb 12 14:08:07 1989 ! 1399: --- pax.c Sun Feb 12 14:02:25 1989 ! 1400: *************** ! 1401: *** 1,6 ! 1402: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 1403: * ! 1404: ! * $Revision: 1.1 $ ! 1405: * ! 1406: * DESCRIPTION ! 1407: * ! 1408: ! 1409: --- 1,6 ----- ! 1410: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 1411: * ! 1412: ! * $Revision: 1.1 $ ! 1413: * ! 1414: * DESCRIPTION ! 1415: * ! 1416: *************** ! 1417: *** 46,52 ! 1418: * ! 1419: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1420: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1421: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1422: * ! 1423: * $Log: patch2,v $ ! 1424: # Revision 1.1 92/08/28 08:02:34 bin ! 1425: # Initial revision ! 1426: # ! 1427: * Revision 1.1 88/12/23 18:02:23 mark ! 1428: ! 1429: --- 46,52 ----- ! 1430: * ! 1431: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1432: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1433: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1434: * ! 1435: * $Log: patch2,v $ ! 1436: # Revision 1.1 92/08/28 08:02:34 bin ! 1437: # Initial revision ! 1438: # ! 1439: * Revision 1.2 89/02/12 10:05:17 mark ! 1440: *************** ! 1441: *** 49,54 ! 1442: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1443: * ! 1444: * $Log: patch2,v $ ! 1445: # Revision 1.1 92/08/28 08:02:34 bin ! 1446: # Initial revision ! 1447: # ! 1448: * Revision 1.1 88/12/23 18:02:23 mark ! 1449: * Initial revision ! 1450: * ! 1451: ! 1452: --- 49,57 ----- ! 1453: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1454: * ! 1455: * $Log: patch2,v $ ! 1456: # Revision 1.1 92/08/28 08:02:34 bin ! 1457: # Initial revision ! 1458: # ! 1459: + * Revision 1.2 89/02/12 10:05:17 mark ! 1460: + * 1.2 release fixes ! 1461: + * ! 1462: * Revision 1.1 88/12/23 18:02:23 mark ! 1463: * Initial revision ! 1464: * ! 1465: *************** ! 1466: *** 55,61 ! 1467: */ ! 1468: ! 1469: #ifndef lint ! 1470: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 1471: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 1472: #endif /* ! lint */ ! 1473: ! 1474: ! 1475: --- 58,64 ----- ! 1476: */ ! 1477: ! 1478: #ifndef lint ! 1479: ! static char *ident = "$Id: patch2,v 1.1 92/08/28 08:02:34 bin Exp Locker: bin $"; ! 1480: static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n"; ! 1481: #endif /* ! lint */ ! 1482: ! 1483: *************** ! 1484: *** 88,94 ! 1485: OFFSET total; /* Total number of bytes transferred */ ! 1486: short f_access_time; /* Reset access times of input files */ ! 1487: short areof; /* End of input volume reached */ ! 1488: ! short f_create_dirs; /* Create missing directories */ ! 1489: short f_append; /* Add named files to end of archive */ ! 1490: short f_create; /* create a new archive */ ! 1491: short f_extract; /* Extract named files from archive */ ! 1492: ! 1493: --- 91,97 ----- ! 1494: OFFSET total; /* Total number of bytes transferred */ ! 1495: short f_access_time; /* Reset access times of input files */ ! 1496: short areof; /* End of input volume reached */ ! 1497: ! short f_dir_create; /* Create missing directories */ ! 1498: short f_append; /* Add named files to end of archive */ ! 1499: short f_create; /* create a new archive */ ! 1500: short f_extract; /* Extract named files from archive */ ! 1501: *************** ! 1502: *** 104,110 ! 1503: short f_newer; /* append files to archive if newer */ ! 1504: short f_disposition; /* ask for file disposition */ ! 1505: short f_reverse_match; /* Reverse sense of pattern match */ ! 1506: ! short f_modification_time; /* Retain file modification time */ ! 1507: short f_unconditional; /* Copy unconditionally */ ! 1508: time_t now = 0; /* Current time */ ! 1509: uint arvolume; /* Volume number */ ! 1510: ! 1511: --- 107,113 ----- ! 1512: short f_newer; /* append files to archive if newer */ ! 1513: short f_disposition; /* ask for file disposition */ ! 1514: short f_reverse_match; /* Reverse sense of pattern match */ ! 1515: ! short f_mtime; /* Retain file modification time */ ! 1516: short f_unconditional; /* Copy unconditionally */ ! 1517: time_t now = 0; /* Current time */ ! 1518: uint arvolume; /* Volume number */ ! 1519: *************** ! 1520: *** 110,116 ! 1521: uint arvolume; /* Volume number */ ! 1522: uint blocksize = BLOCKSIZE; /* Archive block size */ ! 1523: FILE *msgfile; /* message outpu file stdout/stderr */ ! 1524: ! Replstr *rplhead = NULL; /* pointer to head of replstr list */ ! 1525: Replstr *rpltail; /* pointer to tail of replstr list */ ! 1526: ! 1527: ! 1528: ! 1529: --- 113,119 ----- ! 1530: uint arvolume; /* Volume number */ ! 1531: uint blocksize = BLOCKSIZE; /* Archive block size */ ! 1532: FILE *msgfile; /* message outpu file stdout/stderr */ ! 1533: ! Replstr *rplhead = (Replstr *)NULL; /* head of replstr list */ ! 1534: Replstr *rpltail; /* pointer to tail of replstr list */ ! 1535: ! 1536: ! 1537: *************** ! 1538: *** 234,241 ! 1539: * of the tar and/or cpio interfaces... ! 1540: */ ! 1541: f_unconditional = 1; ! 1542: ! f_modification_time = 1; ! 1543: ! f_create_dirs = 1; ! 1544: f_list = 1; ! 1545: blocksize = 0; ! 1546: blocking = 0; ! 1547: ! 1548: --- 237,244 ----- ! 1549: * of the tar and/or cpio interfaces... ! 1550: */ ! 1551: f_unconditional = 1; ! 1552: ! f_mtime = 1; ! 1553: ! f_dir_create = 1; ! 1554: f_list = 1; ! 1555: blocksize = 0; ! 1556: blocking = 0; ! 1557: *************** ! 1558: *** 258,264 ! 1559: f_reverse_match = 1; ! 1560: break; ! 1561: case 'd': ! 1562: ! f_create_dirs = 0; ! 1563: break; ! 1564: case 'f': ! 1565: if (blocksize == 0) { ! 1566: ! 1567: --- 261,267 ----- ! 1568: f_reverse_match = 1; ! 1569: break; ! 1570: case 'd': ! 1571: ! f_dir_create = 0; ! 1572: break; ! 1573: case 'f': ! 1574: if (blocksize == 0) { ! 1575: *************** ! 1576: *** 274,280 ! 1577: f_link = 1; ! 1578: break; ! 1579: case 'm': ! 1580: ! f_modification_time = 0; ! 1581: break; ! 1582: case 'o': ! 1583: f_owner = 1; ! 1584: ! 1585: --- 277,283 ----- ! 1586: f_link = 1; ! 1587: break; ! 1588: case 'm': ! 1589: ! f_mtime = 0; ! 1590: break; ! 1591: case 'o': ! 1592: f_owner = 1; ! 1593: *************** ! 1594: *** 358,364 ! 1595: } else if (f_pass && optind < n_argc) { ! 1596: dirname = n_argv[--n_argc]; ! 1597: if (LSTAT(dirname, &st) < 0) { ! 1598: ! fatal(syserr()); ! 1599: } ! 1600: if ((st.sb_mode & S_IFMT) != S_IFDIR) { ! 1601: fatal("Not a directory"); ! 1602: ! 1603: --- 361,367 ----- ! 1604: } else if (f_pass && optind < n_argc) { ! 1605: dirname = n_argv[--n_argc]; ! 1606: if (LSTAT(dirname, &st) < 0) { ! 1607: ! fatal(strerror()); ! 1608: } ! 1609: if ((st.sb_mode & S_IFMT) != S_IFDIR) { ! 1610: fatal("Not a directory"); ! 1611: *************** ! 1612: *** 465,471 ! 1613: number = number * 10 + *idx++ - '0'; ! 1614: switch (*idx++) { ! 1615: case 'b': ! 1616: ! result += number * 512; ! 1617: continue; ! 1618: case 'k': ! 1619: result += number * 1024; ! 1620: ! 1621: --- 468,474 ----- ! 1622: number = number * 10 + *idx++ - '0'; ! 1623: switch (*idx++) { ! 1624: case 'b': ! 1625: ! result += number * 512L; ! 1626: continue; ! 1627: case 'k': ! 1628: result += number * 1024L; ! 1629: *************** ! 1630: *** 468,474 ! 1631: result += number * 512; ! 1632: continue; ! 1633: case 'k': ! 1634: ! result += number * 1024; ! 1635: continue; ! 1636: case 'm': ! 1637: result += number * 1024 * 1024; ! 1638: ! 1639: --- 471,477 ----- ! 1640: result += number * 512L; ! 1641: continue; ! 1642: case 'k': ! 1643: ! result += number * 1024L; ! 1644: continue; ! 1645: case 'm': ! 1646: result += number * 1024L * 1024L; ! 1647: *************** ! 1648: *** 471,477 ! 1649: result += number * 1024; ! 1650: continue; ! 1651: case 'm': ! 1652: ! result += number * 1024 * 1024; ! 1653: continue; ! 1654: case '+': ! 1655: result += number; ! 1656: ! 1657: --- 474,480 ----- ! 1658: result += number * 1024L; ! 1659: continue; ! 1660: case 'm': ! 1661: ! result += number * 1024L * 1024L; ! 1662: continue; ! 1663: case '+': ! 1664: result += number; ! 1665: *************** ! 1666: *** 515,522 ! 1667: ! 1668: #endif ! 1669: { ! 1670: ! fprintf(stderr, "\ ! 1671: ! Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1672: myname); ! 1673: fprintf(stderr, "\ ! 1674: %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1675: ! 1676: --- 518,524 ----- ! 1677: ! 1678: #endif ! 1679: { ! 1680: ! fprintf(stderr, "Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1681: myname); ! 1682: fprintf(stderr, " %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1683: myname); ! 1684: *************** ! 1685: *** 518,525 ! 1686: fprintf(stderr, "\ ! 1687: Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1688: myname); ! 1689: ! fprintf(stderr, "\ ! 1690: ! %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1691: myname); ! 1692: fprintf(stderr, "\ ! 1693: %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n\ ! 1694: ! 1695: --- 520,526 ----- ! 1696: { ! 1697: fprintf(stderr, "Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1698: myname); ! 1699: ! fprintf(stderr, " %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1700: myname); ! 1701: fprintf(stderr, " %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n [-t device] [-x format] [pathname...]\n", ! 1702: myname); ! 1703: *************** ! 1704: *** 521,529 ! 1705: fprintf(stderr, "\ ! 1706: %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1707: myname); ! 1708: ! fprintf(stderr, "\ ! 1709: ! %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n\ ! 1710: ! [-t device] [-x format] [pathname...]\n", ! 1711: myname); ! 1712: fprintf(stderr, "\ ! 1713: %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n", ! 1714: ! 1715: --- 522,528 ----- ! 1716: myname); ! 1717: fprintf(stderr, " %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n", ! 1718: myname); ! 1719: ! fprintf(stderr, " %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n [-t device] [-x format] [pathname...]\n", ! 1720: myname); ! 1721: fprintf(stderr, " %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n", ! 1722: myname); ! 1723: *************** ! 1724: *** 525,532 ! 1725: %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n\ ! 1726: [-t device] [-x format] [pathname...]\n", ! 1727: myname); ! 1728: ! fprintf(stderr, "\ ! 1729: ! %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n", ! 1730: myname); ! 1731: exit(1); ! 1732: } ! 1733: ! 1734: --- 524,530 ----- ! 1735: myname); ! 1736: fprintf(stderr, " %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n [-t device] [-x format] [pathname...]\n", ! 1737: myname); ! 1738: ! fprintf(stderr, " %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n", ! 1739: myname); ! 1740: exit(1); ! 1741: } ! 1742: Index: pax.h ! 1743: *** /tmp/,RCSt1a17118 Sun Feb 12 14:08:18 1989 ! 1744: --- pax.h Sun Feb 12 14:02:26 1989 ! 1745: *************** ! 1746: *** 1,6 ! 1747: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 1748: * ! 1749: ! * $Revision: 1.1 $ ! 1750: * ! 1751: * pax.h - defnitions for entire program ! 1752: * ! 1753: ! 1754: --- 1,6 ----- ! 1755: /* $Source: /src386/usr/bin/pax/patch2,v $ ! 1756: * ! 1757: ! * $Revision: 1.1 $ ! 1758: * ! 1759: * pax.h - defnitions for entire program ! 1760: * ! 1761: *************** ! 1762: *** 27,33 ! 1763: * ! 1764: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1765: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1766: ! * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1767: */ ! 1768: ! 1769: #ifndef _PAX_H ! 1770: ! 1771: --- 27,33 ----- ! 1772: * ! 1773: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 1774: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 1775: ! * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 1776: */ ! 1777: ! 1778: #ifndef _PAX_H ! 1779: *************** ! 1780: *** 53,59 ! 1781: # include <dirent.h> ! 1782: # endif ! 1783: #else ! 1784: ! # include <sys/dir.h> ! 1785: # define dirent direct ! 1786: #endif ! 1787: ! 1788: ! 1789: --- 53,67 ----- ! 1790: # include <dirent.h> ! 1791: # endif ! 1792: #else ! 1793: ! # ifdef hpux ! 1794: ! # include <ndir.h> ! 1795: ! # else ! 1796: ! # ifdef XENIX_286 ! 1797: ! # include <sys/ndir.h> ! 1798: ! # else XENIX_286 ! 1799: ! # include <sys/dir.h> ! 1800: ! # endif XENIX_286 ! 1801: ! # endif /* hpux */ ! 1802: # define dirent direct ! 1803: #endif ! 1804: ! 1805: *************** ! 1806: *** 74,79 ! 1807: #ifdef XENIX ! 1808: # include <sys/inode.h> ! 1809: #endif ! 1810: ! 1811: #include <pwd.h> ! 1812: #include <grp.h> ! 1813: ! 1814: --- 82,90 ----- ! 1815: #ifdef XENIX ! 1816: # include <sys/inode.h> ! 1817: #endif ! 1818: + #ifdef XENIX_286 ! 1819: + #include <sys/param.h> ! 1820: + #endif XENIX_286 ! 1821: ! 1822: #include <pwd.h> ! 1823: #include <grp.h> ! 1824: *************** ! 1825: *** 77,82 ! 1826: ! 1827: #include <pwd.h> ! 1828: #include <grp.h> ! 1829: #include <sys/file.h> ! 1830: ! 1831: /* Defines */ ! 1832: ! 1833: --- 88,94 ----- ! 1834: ! 1835: #include <pwd.h> ! 1836: #include <grp.h> ! 1837: + #ifndef XENIX_286 ! 1838: #include <sys/file.h> ! 1839: #endif XENIX_286 ! 1840: ! 1841: *************** ! 1842: *** 78,83 ! 1843: #include <pwd.h> ! 1844: #include <grp.h> ! 1845: #include <sys/file.h> ! 1846: ! 1847: /* Defines */ ! 1848: ! 1849: ! 1850: --- 90,96 ----- ! 1851: #include <grp.h> ! 1852: #ifndef XENIX_286 ! 1853: #include <sys/file.h> ! 1854: + #endif XENIX_286 ! 1855: ! 1856: /* Defines */ ! 1857: ! 1858: *************** ! 1859: *** 331,338 ! 1860: extern short f_pass; ! 1861: extern short f_disposition; ! 1862: extern short f_reverse_match; ! 1863: ! extern short f_modification_time; ! 1864: ! extern short f_create_dirs; ! 1865: extern short f_unconditional; ! 1866: extern short f_newer; ! 1867: extern time_t now; ! 1868: ! 1869: --- 344,351 ----- ! 1870: extern short f_pass; ! 1871: extern short f_disposition; ! 1872: extern short f_reverse_match; ! 1873: ! extern short f_mtime; ! 1874: ! extern short f_dir_create; ! 1875: extern short f_unconditional; ! 1876: extern short f_newer; ! 1877: extern time_t now; ! 1878: Index: paxdir.c ! 1879: *** /tmp/,RCSt1a17123 Sun Feb 12 14:08:27 1989 ! 1880: --- paxdir.c Sun Feb 12 14:02:28 1989 ! 1881: *************** ! 1882: *** 213,219 ! 1883: struct stat sbuf; /* result of fstat() */ ! 1884: ! 1885: if ((fd = open(dirname, O_RDONLY)) < 0) ! 1886: ! return NULL; /* errno set by open() */ ! 1887: ! 1888: if (fstat(fd, &sbuf) != 0 || !S_ISDIR(sbuf.st_mode)) { ! 1889: close(fd); ! 1890: ! 1891: --- 213,219 ----- ! 1892: struct stat sbuf; /* result of fstat() */ ! 1893: ! 1894: if ((fd = open(dirname, O_RDONLY)) < 0) ! 1895: ! return ((DIR *)NULL); /* errno set by open() */ ! 1896: ! 1897: if (fstat(fd, &sbuf) != 0 || !S_ISDIR(sbuf.st_mode)) { ! 1898: close(fd); ! 1899: *************** ! 1900: *** 218,224 ! 1901: if (fstat(fd, &sbuf) != 0 || !S_ISDIR(sbuf.st_mode)) { ! 1902: close(fd); ! 1903: errno = ENOTDIR; ! 1904: ! return NULL; /* not a directory */ ! 1905: } ! 1906: if ((dirp = (DIR *) malloc(sizeof(DIR))) == NULL ! 1907: || (dirp->dd_buf = (char *) malloc((unsigned) DIRBUF)) == NULL ! 1908: ! 1909: --- 218,224 ----- ! 1910: if (fstat(fd, &sbuf) != 0 || !S_ISDIR(sbuf.st_mode)) { ! 1911: close(fd); ! 1912: errno = ENOTDIR; ! 1913: ! return ((DIR *)NULL); /* not a directory */ ! 1914: } ! 1915: if ((dirp = (DIR *) malloc(sizeof(DIR))) == (DIR *)NULL ! 1916: || (dirp->dd_buf = (char *) malloc((unsigned) DIRBUF)) == (char *)NULL ! 1917: *************** ! 1918: *** 220,227 ! 1919: errno = ENOTDIR; ! 1920: return NULL; /* not a directory */ ! 1921: } ! 1922: ! if ((dirp = (DIR *) malloc(sizeof(DIR))) == NULL ! 1923: ! || (dirp->dd_buf = (char *) malloc((unsigned) DIRBUF)) == NULL ! 1924: ) { ! 1925: register int serrno = errno; ! 1926: /* errno set to ENOMEM by sbrk() */ ! 1927: ! 1928: --- 220,227 ----- ! 1929: errno = ENOTDIR; ! 1930: return ((DIR *)NULL); /* not a directory */ ! 1931: } ! 1932: ! if ((dirp = (DIR *) malloc(sizeof(DIR))) == (DIR *)NULL ! 1933: ! || (dirp->dd_buf = (char *) malloc((unsigned) DIRBUF)) == (char *)NULL ! 1934: ) { ! 1935: register int serrno = errno; ! 1936: /* errno set to ENOMEM by sbrk() */ ! 1937: *************** ! 1938: *** 226,232 ! 1939: register int serrno = errno; ! 1940: /* errno set to ENOMEM by sbrk() */ ! 1941: ! 1942: ! if (dirp != NULL) ! 1943: free((pointer) dirp); ! 1944: ! 1945: close(fd); ! 1946: ! 1947: --- 226,232 ----- ! 1948: register int serrno = errno; ! 1949: /* errno set to ENOMEM by sbrk() */ ! 1950: ! 1951: ! if (dirp != (DIR *)NULL) ! 1952: free((pointer) dirp); ! 1953: ! 1954: close(fd); ! 1955: *************** ! 1956: *** 231,237 ! 1957: ! 1958: close(fd); ! 1959: errno = serrno; ! 1960: ! return NULL; /* not enough memory */ ! 1961: } ! 1962: dirp->dd_fd = fd; ! 1963: dirp->dd_loc = dirp->dd_size = 0; /* refill needed */ ! 1964: ! 1965: --- 231,237 ----- ! 1966: ! 1967: close(fd); ! 1968: errno = serrno; ! 1969: ! return ((DIR *)NULL); /* not enough memory */ ! 1970: } ! 1971: dirp->dd_fd = fd; ! 1972: dirp->dd_loc = dirp->dd_size = 0; /* refill needed */ ! 1973: *************** ! 1974: *** 259,265 ! 1975: { ! 1976: register int fd; ! 1977: ! 1978: ! if ( dirp == NULL || dirp->dd_buf == NULL ) { ! 1979: errno = EFAULT; ! 1980: return -1; /* invalid pointer */ ! 1981: } ! 1982: ! 1983: --- 259,265 ----- ! 1984: { ! 1985: register int fd; ! 1986: ! 1987: ! if ( dirp == (DIR *)NULL || dirp->dd_buf == (char *)NULL ) { ! 1988: errno = EFAULT; ! 1989: return -1; /* invalid pointer */ ! 1990: } ! 1991: *************** ! 1992: *** 290,296 ! 1993: { ! 1994: register struct dirent *dp; /* -> directory data */ ! 1995: ! 1996: ! if (dirp == NULL || dirp->dd_buf == NULL) { ! 1997: errno = EFAULT; ! 1998: return NULL; /* invalid pointer */ ! 1999: } ! 2000: ! 2001: --- 290,296 ----- ! 2002: { ! 2003: register struct dirent *dp; /* -> directory data */ ! 2004: ! 2005: ! if (dirp == (DIR *)NULL || dirp->dd_buf == (char *)NULL) { ! 2006: errno = EFAULT; ! 2007: return (struct dirent *)NULL; /* invalid pointer */ ! 2008: } ! 2009: *************** ! 2010: *** 292,298 ! 2011: ! 2012: if (dirp == NULL || dirp->dd_buf == NULL) { ! 2013: errno = EFAULT; ! 2014: ! return NULL; /* invalid pointer */ ! 2015: } ! 2016: do { ! 2017: if (dirp->dd_loc >= dirp->dd_size) /* empty or obsolete */ ! 2018: ! 2019: --- 292,298 ----- ! 2020: ! 2021: if (dirp == (DIR *)NULL || dirp->dd_buf == (char *)NULL) { ! 2022: errno = EFAULT; ! 2023: ! return (struct dirent *)NULL; /* invalid pointer */ ! 2024: } ! 2025: do { ! 2026: if (dirp->dd_loc >= dirp->dd_size) /* empty or obsolete */ ! 2027: *************** ! 2028: *** 303,309 ! 2029: getdents(dirp->dd_fd, dirp->dd_buf, (unsigned) DIRBUF) ! 2030: ) <= 0 ! 2031: ) ! 2032: ! return NULL; /* EOF or error */ ! 2033: ! 2034: dp = (struct dirent *) & dirp->dd_buf[dirp->dd_loc]; ! 2035: dirp->dd_loc += dp->d_reclen; ! 2036: ! 2037: --- 303,309 ----- ! 2038: getdents(dirp->dd_fd, dirp->dd_buf, (unsigned) DIRBUF) ! 2039: ) <= 0 ! 2040: ) ! 2041: ! return ((struct dirent *)NULL); /* EOF or error */ ! 2042: ! 2043: dp = (struct dirent *) & dirp->dd_buf[dirp->dd_loc]; ! 2044: dirp->dd_loc += dp->d_reclen; ! 2045: *************** ! 2046: *** 340,346 ! 2047: { ! 2048: register bool rewind; /* "start over when stymied" flag */ ! 2049: ! 2050: ! if (dirp == NULL || dirp->dd_buf == NULL) { ! 2051: errno = EFAULT; ! 2052: return; /* invalid pointer */ ! 2053: } ! 2054: ! 2055: --- 340,346 ----- ! 2056: { ! 2057: register bool rewind; /* "start over when stymied" flag */ ! 2058: ! 2059: ! if (dirp == (DIR *)NULL || dirp->dd_buf == (char *)NULL) { ! 2060: errno = EFAULT; ! 2061: return; /* invalid pointer */ ! 2062: } ! 2063: *************** ! 2064: *** 372,378 ! 2065: /* See whether the matching entry is in the current buffer. */ ! 2066: ! 2067: if ((dirp->dd_loc < dirp->dd_size /* valid index */ ! 2068: ! || readdir(dirp) != NULL /* next buffer read */ ! 2069: && (dirp->dd_loc = 0, true) /* beginning of buffer set */ ! 2070: ) ! 2071: && (dp = (struct dirent *) & dirp->dd_buf[dirp->dd_loc])->d_off ! 2072: ! 2073: --- 372,378 ----- ! 2074: /* See whether the matching entry is in the current buffer. */ ! 2075: ! 2076: if ((dirp->dd_loc < dirp->dd_size /* valid index */ ! 2077: ! || readdir(dirp) != (struct dirent *)NULL /* next buffer read */ ! 2078: && (dirp->dd_loc = 0, true) /* beginning of buffer set */ ! 2079: ) ! 2080: && (dp = (struct dirent *) & dirp->dd_buf[dirp->dd_loc])->d_off ! 2081: *************** ! 2082: *** 442,448 ! 2083: ! 2084: #endif ! 2085: { ! 2086: ! if (dirp == NULL || dirp->dd_buf == NULL) { ! 2087: errno = EFAULT; ! 2088: return -1; /* invalid pointer */ ! 2089: } ! 2090: ! 2091: --- 442,448 ----- ! 2092: ! 2093: #endif ! 2094: { ! 2095: ! if (dirp == (DIR *)NULL || dirp->dd_buf == (char *)NULL) { ! 2096: errno = EFAULT; ! 2097: return -1; /* invalid pointer */ ! 2098: } ! 2099: *************** ! 2100: *** 593,599 ! 2101: } ! 2102: #endif ! 2103: ! 2104: ! if (buf == NULL ! 2105: #ifdef ATT_SPEC ! 2106: || (unsigned long) buf % sizeof(long) != 0 /* ugh */ ! 2107: #endif ! 2108: ! 2109: --- 593,599 ----- ! 2110: } ! 2111: #endif ! 2112: ! 2113: ! if (buf == (char *)NULL ! 2114: #ifdef ATT_SPEC ! 2115: || (unsigned long) buf % sizeof(long) != 0 /* ugh */ ! 2116: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.