Changeset 1472
- Timestamp:
- Oct 19, 2009, 7:43:42 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r1470 r1472 13 13 o Avoid traps when changing tree container display style 14 14 o Restore missing drives to drive list dropdown 15 o Correct docopyf regression which caused move to same volume to fail with access denied 15 16 16 17 3.17 -
trunk/dll/copyf.c
r1469 r1472 12 12 14 Oct 02 SHL Drop obsolete debug code 13 13 10 Nov 02 SHL docopyf - don't forget to terminate longname 14 14 optimize longname logic 15 15 01 Aug 04 SHL Rework lstrip/rstrip usage 16 16 28 May 05 SHL Drop debug code … … 25 25 13 Jul 09 SHL Drop obsolete code 26 26 22 Jul 09 GKY Delete .LONGNAME EA if it becomes the filename on a copy or move. 27 19 Oct 09 SHL Correct copyf regression when moving to save volume 27 28 28 29 ***********************************************************************/ … … 46 47 #include "arccnrs.h" 47 48 #include "fm3str.h" 48 #include "errutil.h" 49 #include "strutil.h" 49 #include "errutil.h" // Dos_Error... 50 #include "strutil.h" // GetPString 50 51 #include "copyf.h" 51 #include "literal.h" 52 #include "literal.h" // fixup 52 53 #include "misc.h" // Broadcast 53 54 #include "valid.h" // MakeFullName 54 55 #include "wrappers.h" // xDosSetPathInfo 55 56 #include "strips.h" // bstrip 56 #include "fortify.h" 57 #include "pathutil.h" 57 #include "fortify.h" 58 #include "pathutil.h" // AddBackslashToPath 58 59 59 60 static PSZ pszSrcFile = __FILE__; … … 67 68 #ifndef WinMoveObject 68 69 HOBJECT APIENTRY WinMoveObject(HOBJECT hObjectofObject, 69 70 HOBJECT hObjectofDest, ULONG ulReserved); 70 71 #endif 71 72 #ifndef WinCopyObject 72 73 HOBJECT APIENTRY WinCopyObject(HOBJECT hObjectofObject, 73 74 HOBJECT hObjectofDest, ULONG ulReserved); 74 75 #endif 75 76 76 char *MakeTempName(char *buffer, char *temproot, INT type) 77 /** 78 * Make temporary file name 79 * @param buffer is input directory name and output file name buffer 80 * @param temproot is filename root used by type 2 81 * @param type is name style 82 * @return pointer to name in buffer or NULL if failed 83 * @note not MT safe 84 */ 85 86 PSZ MakeTempName(PSZ buffer, PSZ temproot, INT type) 77 87 { 78 88 FILESTATUS3 fs3; 79 89 APIRET rc; 80 char *p, *o; 81 82 if (strlen(buffer) > 3) // && buffer[strlen(buffer) - 1] != '\\') 90 PSZ p; 91 PSZ o; 92 93 if (strlen(buffer) > 3) 83 94 AddBackslashToPath(buffer); 84 //strcat(buffer, "\\");85 95 p = o = buffer + strlen(buffer); 86 96 switch (type) { … … 115 125 (*p)++; 116 126 while (strchr("*?<>\":/\\|+=;,[]. ", *p)) 117 127 (*p)++; 118 128 *p = toupper(*p); 119 129 } … … 121 131 p--; 122 132 if (p >= o && *p == '.') 123 133 p--; 124 134 goto Loop; 125 135 } … … 151 161 f = oldname + (f - buffer); 152 162 strupr(buffer); 153 while (*f == '.') /* skip leading '.'s */154 f++; 163 while (*f == '.') 164 f++; // skip leading '.'s 155 165 s = f; 156 while (*f && *f != '.' && f < s + 8) { /* skip past rootname */ 166 // skip past rootname 167 while (*f && *f != '.' && f < s + 8) { 157 168 *p = toupper(*f); 158 169 p++; … … 209 220 (*p)++; 210 221 while (strchr("*?<>\":/\\|+=;,[]. ", *p)) 211 222 (*p)++; 212 223 *p = toupper(*p); 213 224 } … … 215 226 p--; 216 227 if (p >= o && *p == '.') 217 228 p--; 218 229 goto Loop; 219 230 } … … 243 254 while (*value) { 244 255 if (*value == '/') 245 256 *value = '\\'; 246 257 value++; 247 258 } … … 260 271 pfealist = xmallocz(1536, pszSrcFile, __LINE__); 261 272 if (pfealist) { 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 273 pfealist->cbList = 1024; 274 eaop.fpGEA2List = pgealist; 275 eaop.fpFEA2List = pfealist; 276 eaop.oError = 0L; 277 DosError(FERR_DISABLEHARDERR); 278 rc = DosQueryPathInfo(oldname, 279 FIL_QUERYEASFROMLIST, 280 (PVOID) & eaop, (ULONG) sizeof(EAOP2)); 281 if (!rc) { 282 pfea = &eaop.fpFEA2List->list[0]; 283 value = pfea->szName + pfea->cbName + 1; 284 value[pfea->cbValue] = 0; 285 if (*(USHORT *) value == EAT_ASCII) 286 strncat(longname, 287 value + (sizeof(USHORT) * 2), 288 CCHMAXPATH - strlen(longname)); 289 longname[CCHMAXPATH - 1] = 0; 290 } 291 free(pfealist); 281 292 } 282 293 free(pgealist); … … 286 297 } 287 298 288 BOOL ZapLongName( char *filename)299 BOOL ZapLongName(PSZ filename) 289 300 { 290 301 return WriteLongName(filename, NullStr); … … 315 326 ealen = sizeof(FEALIST) + 10; 316 327 rc = xDosAllocMem((PPVOID) & pfealist, 317 318 328 ealen + 32L, PAG_COMMIT | PAG_READ | PAG_WRITE, 329 pszSrcFile, __LINE__); 319 330 if (rc) 320 331 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 321 332 GetPString(IDS_OUTOFMEMORY)); 322 333 else { 323 334 memset(pfealist, 0, ealen + 1); … … 343 354 DosError(FERR_DISABLEHARDERR); 344 355 rc = xDosSetPathInfo(filename, FIL_QUERYEASIZE, 345 356 &eaop, sizeof(eaop), DSPI_WRTTHRU); 346 357 DosFreeMem(pfealist); 347 358 if (rc) … … 355 366 BOOL ret = FALSE; 356 367 357 / * NOTE: newname should be CCHMAXPATH chars long! */368 // NOTE: newname should be CCHMAXPATH chars long! 358 369 359 370 if (strchr(newname, '*') || strchr(newname, '?')) { … … 367 378 p = strrchr(oldname, '\\'); 368 379 if (p && *(p + 1)) { 369 370 371 372 373 374 375 376 380 strcpy(srce, p + 1); 381 DosError(FERR_DISABLEHARDERR); 382 if (!DosEditName(1L, srce, dest, (PBYTE)result, (ULONG)sizeof(result))) { 383 p = strrchr(newname, '\\'); 384 p++; 385 strcpy(p, result); 386 ret = TRUE; 387 } 377 388 } 378 389 } … … 381 392 } 382 393 394 /** Copy/move file 395 * @param type is copy/move type 396 * @param oldname is fully qualified source file name 397 * @param newname is fully qualified destination file name 398 * @return 399 * 0: success 400 * -1: bad parameter(s) 401 * -2: source does not exist 402 * -3: bad copy/move type 403 * anything else: API return 404 */ 405 383 406 APIRET docopyf(INT type, CHAR *oldname, CHAR *newname) 384 407 { 385 /*386 * returns:387 * 0: success388 * -1: bad string parameter(s)389 * -2: source didn't exist390 * -3: bad type391 * anything else: API return392 */393 394 408 CHAR longname[CCHMAXPATH], shortname[CCHMAXPATH]; 395 409 CHAR olddisk, newdisk, dir[CCHMAXPATH], *p, *pp; … … 400 414 *shortname = *dir = 0; 401 415 402 if (!oldname || !*oldname || !*newname) /* bad string args */403 return (APIRET) - 1;416 if (!oldname || !*oldname || !*newname) 417 return (APIRET)-1; // bad args 404 418 405 419 DosError(FERR_DISABLEHARDERR); 406 420 if (DosQueryPathInfo(oldname, FIL_STANDARDL, &st, sizeof(FILESTATUS3L))) 407 return (APIRET) - 2; /* no source */421 return (APIRET)-2; // can not access source 408 422 409 423 AdjustWildcardName(oldname, newname); 410 424 MakeFullName(oldname); 411 425 MakeFullName(newname); 412 olddisk = toupper(*oldname); /* source drive */413 newdisk = toupper(*newname); /* destination drive */426 olddisk = toupper(*oldname); // source drive 427 newdisk = toupper(*newname); // destination drive 414 428 if (!(driveflags[toupper(*oldname) - 'A'] & DRIVE_NOLONGNAMES)) 415 429 *longname = 0; … … 419 433 p = RootName(longname); 420 434 if (p != longname) 421 422 } 423 } 424 / * If root name changed make sure longname EA goes away */435 memmove(longname, p, strlen(p) + 1); 436 } 437 } 438 // If root name changed make sure longname EA goes away 425 439 if (*longname) { 426 440 p = RootName(oldname); … … 441 455 hobjsrc = WinQueryObject(oldname); 442 456 if (hobjsrc) { 443 444 445 446 447 448 449 450 451 452 453 454 455 457 strcpy(dir, newname); 458 p = strrchr(dir, '\\'); 459 if (p < dir + 3) 460 p++; 461 *p = 0; 462 ret = ERROR_PATH_NOT_FOUND; 463 hobjdest = WinQueryObject(dir); 464 if (hobjdest) { 465 ret = ERROR_GEN_FAILURE; 466 hobjsrc = WinMoveObject(hobjsrc, hobjdest, 0); 467 if (hobjsrc) 468 ret = 0; 469 } 456 470 } 457 471 } … … 466 480 hobjsrc = WinQueryObject(oldname); 467 481 if (hobjsrc) { 468 469 470 471 472 473 474 475 476 477 478 479 480 482 strcpy(dir, newname); 483 p = strrchr(dir, '\\'); 484 if (p < dir + 3) 485 p++; 486 *p = 0; 487 ret = ERROR_PATH_NOT_FOUND; 488 hobjdest = WinQueryObject(dir); 489 if (hobjdest) { 490 ret = ERROR_GEN_FAILURE; 491 hobjsrc = WinCopyObject(hobjsrc, hobjdest, 0); 492 if (hobjsrc) 493 ret = 0; 494 } 481 495 } 482 496 } … … 485 499 case MOVE: 486 500 *dir = 0; 487 if (olddisk == newdisk) { /* same drive */ 488 /* make temporary copy in case move fails */ 501 if (olddisk == newdisk) { 502 // Moving to same drive 503 // make temporary copy in case move fails 489 504 if (IsFile(newname) != -1 && stricmp(oldname, newname)) { 490 strcpy(dir, newname); 491 AddBackslashToPath(dir);492 //p = strrchr(dir, '\\');493 //if (p)494 //*p = 0;495 //strcat(dir, "\\");496 497 498 *dir = 0; 505 // 19 Oct 09 SHL correct regression 506 strcpy(dir, newname); 507 p = strrchr(dir, '\\'); 508 if (p) 509 *p = 0; 510 AddBackslashToPath(dir); 511 MakeTempName(dir, NULL, 0); 512 if (DosMove(newname, dir)) 513 *dir = 0; // Avoid trying to restore bad copy 499 514 } 500 515 DosError(FERR_DISABLEHARDERR); 501 ret = DosMove(oldname, newname); /* move it */502 if (ret && *dir) { /* failed -- clean up */503 504 505 516 ret = DosMove(oldname, newname); // move it 517 if (ret && *dir) { // failed -- clean up 518 DosError(FERR_DISABLEHARDERR); 519 if (!DosMove(dir, newname)) 520 Broadcast((HAB) 0, hwndMain, UM_UPDATERECORD, MPFROMP(dir), MPVOID); 506 521 } 507 522 else if (!ret && *dir) { 508 if (!IsFile(dir)) { 509 if (!strchr(dir, '?') && !strchr(dir, '*')) 510 wipeallf("%s\\*", dir); 511 DosError(FERR_DISABLEHARDERR); 512 if (DosDeleteDir(dir)) { 513 make_deleteable(dir); 514 DosDeleteDir(dir); 515 } 516 } 517 else if (IsFile(dir) > 0) { 518 DosError(FERR_DISABLEHARDERR); 519 if (DosForceDelete(dir)) { 520 make_deleteable(dir); 521 DosForceDelete(dir); 522 } 523 if (zaplong) { 524 ret = ZapLongName(dir); 525 } 526 Broadcast((HAB) 0, hwndMain, UM_UPDATERECORD, MPFROMP(dir), MPVOID); 527 } 528 } 529 } 530 else { /* different drives */ 523 if (!IsFile(dir)) { 524 if (!strchr(dir, '?') && !strchr(dir, '*')) 525 wipeallf("%s\\*", dir); 526 DosError(FERR_DISABLEHARDERR); 527 if (DosDeleteDir(dir)) { 528 make_deleteable(dir); 529 DosDeleteDir(dir); 530 } 531 } 532 else if (IsFile(dir) > 0) { 533 DosError(FERR_DISABLEHARDERR); 534 if (DosForceDelete(dir)) { 535 make_deleteable(dir); 536 DosForceDelete(dir); 537 } 538 if (zaplong) { 539 ret = ZapLongName(dir); 540 } 541 Broadcast((HAB) 0, hwndMain, UM_UPDATERECORD, MPFROMP(dir), MPVOID); 542 } 543 } 544 } 545 else { 546 // Moving to different drive 531 547 DosError(FERR_DISABLEHARDERR); 532 ret = DosCopy(oldname, newname, DCPY_EXISTING); /* <=-NOTE! */548 ret = DosCopy(oldname, newname, DCPY_EXISTING); // <=-NOTE! 533 549 if (ret == ERROR_DISK_CHANGE) { 534 535 536 550 DosError(FERR_ENABLEHARDERR); 551 ret = DosCopy(oldname, newname, DCPY_EXISTING); 552 diskchange = TRUE; 537 553 } 538 554 if (ret == ERROR_INVALID_NAME || ret == ERROR_FILENAME_EXCED_RANGE) { 539 if (TruncName(newname, shortname)) { /* make 8.3 filename */ 540 DosError(FERR_DISABLEHARDERR); 541 ret = DosCopy(oldname, shortname, DCPY_EXISTING); 542 if (!ret) { /* success -- write longname ea */ 543 WriteLongName(shortname, newname); 544 strcpy(newname, shortname); 545 /* broadcast fixup msg to windows */ 546 Broadcast((HAB) 0, 547 hwndMain, UM_UPDATERECORD, MPFROMP(shortname), MPVOID); 548 } 549 } 555 if (TruncName(newname, shortname)) { 556 // make 8.3 filename 557 DosError(FERR_DISABLEHARDERR); 558 ret = DosCopy(oldname, shortname, DCPY_EXISTING); 559 if (!ret) { 560 // success -- write longname ea 561 WriteLongName(shortname, newname); 562 strcpy(newname, shortname); 563 // broadcast fixup msg to windows 564 Broadcast((HAB) 0, 565 hwndMain, UM_UPDATERECORD, MPFROMP(shortname), MPVOID); 566 } 567 } 550 568 } 551 569 else if (!ret && *longname) { 552 570 553 CHAR fixname[CCHMAXPATH]; 554 555 strcpy(fixname, newname); 556 p = strrchr(fixname, '\\'); 557 if (p) { 558 p++; 559 *p = 0; 560 } 561 strcat(fixname, longname); 562 DosError(FERR_DISABLEHARDERR); 563 DosMove(newname, fixname); 564 strcpy(newname, fixname); 565 if (zaplong) 566 ZapLongName(fixname); 567 Broadcast((HAB) 0, 568 hwndMain, UM_UPDATERECORD, MPFROMP(fixname), MPVOID); 569 } 570 if (!ret) { /* double-check success */ 571 DosError(FERR_DISABLEHARDERR); 572 rc = DosQueryPathInfo(newname, 573 FIL_STANDARDL, &st2, sizeof(FILESTATUS3L)); 574 if (rc == ERROR_DISK_CHANGE) { 575 DosError(FERR_ENABLEHARDERR); 576 rc = DosQueryPathInfo(newname, 577 FIL_STANDARDL, &st2, sizeof(FILESTATUS3L)); 578 } 579 if (!rc && st2.cbFile == st.cbFile) { /* seems to have worked... */ 580 DosError(FERR_DISABLEHARDERR); 581 if (diskchange) { 582 DosError(FERR_ENABLEHARDERR); 583 DosQueryPathInfo(oldname, FIL_STANDARDL, &dummy, sizeof(FILESTATUS3L)); /* force disk change */ 584 } 585 if (!(st2.attrFile & FILE_DIRECTORY)) /* erase file */ 586 unlinkf(oldname); 587 else { /* remove directory */ 588 wipeallf("%s\\*", oldname); 589 DosError(FERR_DISABLEHARDERR); 590 if (DosDeleteDir(oldname)) { 591 make_deleteable(oldname); 592 DosDeleteDir(oldname); 593 } 594 } 595 } 571 CHAR fixname[CCHMAXPATH]; 572 573 strcpy(fixname, newname); 574 p = strrchr(fixname, '\\'); 575 if (p) { 576 p++; 577 *p = 0; 578 } 579 strcat(fixname, longname); 580 DosError(FERR_DISABLEHARDERR); 581 DosMove(newname, fixname); 582 strcpy(newname, fixname); 583 if (zaplong) 584 ZapLongName(fixname); 585 Broadcast((HAB) 0, 586 hwndMain, UM_UPDATERECORD, MPFROMP(fixname), MPVOID); 587 } 588 if (!ret) { 589 // double-check success 590 DosError(FERR_DISABLEHARDERR); 591 rc = DosQueryPathInfo(newname, 592 FIL_STANDARDL, &st2, sizeof(FILESTATUS3L)); 593 if (rc == ERROR_DISK_CHANGE) { 594 DosError(FERR_ENABLEHARDERR); 595 rc = DosQueryPathInfo(newname, 596 FIL_STANDARDL, &st2, sizeof(FILESTATUS3L)); 597 } 598 if (!rc && st2.cbFile == st.cbFile) { 599 // seems to have worked... 600 DosError(FERR_DISABLEHARDERR); 601 if (diskchange) { 602 DosError(FERR_ENABLEHARDERR); 603 DosQueryPathInfo(oldname, FIL_STANDARDL, &dummy, sizeof(FILESTATUS3L)); // force disk change 604 } 605 if (!(st2.attrFile & FILE_DIRECTORY)) 606 unlinkf(oldname); // erase file 607 else { 608 // remove directory 609 wipeallf("%s\\*", oldname); 610 DosError(FERR_DISABLEHARDERR); 611 if (DosDeleteDir(oldname)) { 612 make_deleteable(oldname); 613 DosDeleteDir(oldname); 614 } 615 } 616 } 596 617 } 597 618 } … … 600 621 case COPY: 601 622 DosError(FERR_DISABLEHARDERR); 602 ret = DosCopy(oldname, newname, DCPY_EXISTING); /* <=-NOTE! */623 ret = DosCopy(oldname, newname, DCPY_EXISTING); // <=-NOTE! 603 624 if (ret == ERROR_DISK_CHANGE) { 604 625 DosError(FERR_ENABLEHARDERR); … … 608 629 if (ret == ERROR_INVALID_NAME || ret == ERROR_FILENAME_EXCED_RANGE) { 609 630 if (TruncName(newname, shortname)) { 610 611 612 613 614 615 616 617 631 DosError((diskchange) ? FERR_ENABLEHARDERR : FERR_DISABLEHARDERR); 632 ret = DosCopy(oldname, shortname, DCPY_EXISTING); 633 if (!ret) { 634 WriteLongName(shortname, newname); 635 strcpy(newname, shortname); 636 Broadcast((HAB) 0, 637 hwndMain, UM_UPDATERECORD, MPFROMP(shortname), MPVOID); 638 } 618 639 } 619 640 } … … 625 646 p = strrchr(fixname, '\\'); 626 647 if (p) { 627 628 648 p++; 649 *p = 0; 629 650 } 630 651 strcat(fixname, longname); … … 632 653 DosMove(newname, fixname); 633 654 if (zaplong) 634 655 ZapLongName(fixname); 635 656 Broadcast((HAB) 0, hwndMain, UM_UPDATERECORD, MPFROMP(fixname), MPVOID); 636 657 } 637 658 return ret; 638 659 639 default: /* shouldn't happen */ 660 default: 661 // shouldn't happen 640 662 Runtime_Error(pszSrcFile, __LINE__, "bad case %u", type); 641 663 break; 642 } 643 return (APIRET) - 3; /* bad type */ 664 } // switch type 665 Runtime_Error(pszSrcFile, __LINE__, "copy/move type %u unexpected", type); 666 return (APIRET)-3; // bad copy/move type 644 667 } 645 668 … … 659 682 } 660 683 684 /** 685 * unlink everything from directory on down... 686 */ 687 661 688 INT wipeallf(CHAR *string, ...) 662 689 { 663 /* unlink everything from directory on down... */664 665 690 FILEFINDBUF3 *f; 666 691 HDIR search_handle; … … 687 712 return -1; 688 713 689 { /* safety net -- disallow deleting a root dir or partial name */ 714 { 715 // safety net -- disallow deleting a root dir or partial name 690 716 CHAR temp; 691 692 717 p = strrchr(str, '\\'); 693 718 if (p) { … … 696 721 *p = 0; 697 722 if (IsRoot(str) || !IsFullName(str)) { 698 /* under no circumstances! */ 699 700 701 723 // under no circumstances! 724 Runtime_Error(pszSrcFile, __LINE__, "bad name %s", str); 725 free(str); 726 return -1; 702 727 } 703 728 *p = temp; … … 706 731 707 732 p = s; 708 p = strrchr(s, '\\'); /* strip s to just path */733 p = strrchr(s, '\\'); // strip s to just path 709 734 if (!p) 710 735 p = strrchr(s, ':'); … … 734 759 DosError(FERR_DISABLEHARDERR); 735 760 if (!DosFindFirst(str, &search_handle, FILE_NORMAL | FILE_DIRECTORY | 736 737 761 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN | FILE_ARCHIVED, 762 f, sizeof(FILEFINDBUF3), &num_matches, FIL_STANDARD)) { 738 763 739 764 strcpy(ss, s); … … 743 768 strcpy(p, f->achName); 744 769 if (f->attrFile & FILE_DIRECTORY) { 745 if (strcmp(f->achName, ".") && strcmp(f->achName, "..")) { 746 wipeallf("%s/%s", ss, mask); /* recurse to wipe files */ 747 DosError(FERR_DISABLEHARDERR); 748 if (DosDeleteDir(ss)) { /* remove directory */ 749 make_deleteable(ss); 750 DosError(FERR_DISABLEHARDERR); 751 DosDeleteDir(ss); 752 } 753 } 770 if (strcmp(f->achName, ".") && strcmp(f->achName, "..")) { 771 wipeallf("%s/%s", ss, mask); // recurse to wipe files 772 DosError(FERR_DISABLEHARDERR); 773 // remove directory 774 if (DosDeleteDir(ss)) { 775 make_deleteable(ss); // Try harder 776 DosError(FERR_DISABLEHARDERR); 777 DosDeleteDir(ss); 778 } 779 } 754 780 } 755 781 else { 756 757 758 759 760 761 762 763 782 DosError(FERR_DISABLEHARDERR); 783 if (DosForceDelete(ss)) { 784 make_deleteable(ss); 785 DosError(FERR_DISABLEHARDERR); 786 rc = (INT) DosForceDelete(ss); 787 if (rc) 788 return rc; 789 } 764 790 } 765 791 num_matches = 1; 766 792 DosError(FERR_DISABLEHARDERR); 767 793 } while (!DosFindNext(search_handle, f, sizeof(FILEFINDBUF3), 768 794 &num_matches)); 769 795 DosFindClose(search_handle); 770 796 } … … 776 802 } 777 803 778 #if 0 // JBS 11 Sep 08804 #if 0 // JBS 11 Sep 08 fixme to be gone 779 805 INT unlink_allf(CHAR * string, ...) 780 806 { 781 /* wildcard delete */ 782 807 // wildcard delete 783 808 FILEFINDBUF3 *f; 784 809 HDIR search_handle; … … 787 812 CHAR s[CCHMAXPATH]; 788 813 va_list ap; 789 790 814 va_start(ap, string); 791 815 vsprintf(s, string, ap); … … 805 829 806 830 p = s; 807 p = strrchr(s, '\\'); /* strip s to just path */831 p = strrchr(s, '\\'); // strip s to just path 808 832 if (!p) 809 833 p = strrchr(s, ':'); … … 829 853 DosError(FERR_DISABLEHARDERR); 830 854 if (!DosFindFirst(str, &search_handle, FILE_NORMAL, f, 831 855 sizeof(FILEFINDBUF3), &num_matches, FIL_STANDARD)) { 832 856 833 857 strcpy(ss, s); … … 840 864 DosError(FERR_DISABLEHARDERR); 841 865 } while (!DosFindNext(search_handle, f, sizeof(FILEFINDBUF3), 842 866 &num_matches)); 843 867 DosFindClose(search_handle); 844 868 } … … 858 882 INT unlinkf(CHAR *string) 859 883 { 860 861 884 if (!strstr(string, ArcTempRoot)) { 862 885 DosError(FERR_DISABLEHARDERR);
Note:
See TracChangeset
for help on using the changeset viewer.