Changeset 3179 for trunk/essentials
- Timestamp:
- Apr 22, 2007, 9:11:48 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/sys-apps/findutils/gnulib/lib/fts.c
r3170 r3179 77 77 # include "same-inode.h" 78 78 #endif 79 80 81 82 83 84 85 86 79 87 80 88 #include <dirent.h> … … 495 503 } 496 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 497 523 static void 498 524 internal_function … … 511 537 len = p->fts_pathlen = p->fts_namelen; 512 538 memmove(sp->fts_path, p->fts_name, len + 1); 539 540 541 513 542 if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) { 543 514 544 len = strlen(++cp); 515 545 memmove(p->fts_name, cp, len + 1); … … 579 609 */ 580 610 #define NAPPEND(p) \ 581 ( p->fts_path[p->fts_pathlen - 1] == '/'\611 ( \ 582 612 ? p->fts_pathlen - 1 : p->fts_pathlen) 583 613 … … 881 911 * fts_read will work. 882 912 */ 883 if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/'||913 if (p->fts_level != FTS_ROOTLEVEL || || 884 914 ISSET(FTS_NOCHDIR)) 885 915 return (sp->fts_child = fts_build(sp, instr)); … … 1004 1034 */ 1005 1035 if (nlinks || type == BREAD) { 1036 1037 1038 1006 1039 int dir_fd = dirfd(dirp); 1007 1040 if (ISSET(FTS_CWDFD) && 0 <= dir_fd) 1008 1041 dir_fd = dup (dir_fd); 1009 1042 if (dir_fd < 0 || fts_safe_changedir(sp, cur, dir_fd, NULL)) { 1043 1010 1044 if (nlinks && type == BREAD) 1011 1045 cur->fts_errno = errno; … … 1013 1047 descend = false; 1014 1048 closedir(dirp); 1049 1015 1050 if (ISSET(FTS_CWDFD) && 0 <= dir_fd) 1016 1051 close (dir_fd); 1052 1017 1053 dirp = NULL; 1018 1054 } else
Note:
See TracChangeset
for help on using the changeset viewer.
