diff --git a/ncopy.c b/ncopy.c index 2e2d7bc..d3e9cb8 100644 --- a/ncopy.c +++ b/ncopy.c @@ -190,11 +190,6 @@ static int ncopy_is_dir(char *path) return(0); } -static int ncopy_has_wildcards(char *s) -{ - return(s && (strchr(s, '*') || strchr(s, '?'))); -} - static void ncopy_parent_pattern(char *dir, char *pat, char *path) { tool_parent_pattern(dir, pat, path, 260, 260); @@ -1691,13 +1686,13 @@ int func_ncopy(int argc, char *argv[], int mode) ncopy_reset_output_group(); - if (ncopy_has_wildcards(src) || (options & NCOPY_OPT_S)) { + if (tool_has_wildcards(src) || (options & NCOPY_OPT_S)) { if (!ncopy_is_dir(dst)) { fprintf(stdout, " Illegal destination.\n"); ncopy_summary(0, 0); return(1); } - if ((options & NCOPY_OPT_S) && ncopy_is_dir(src) && !ncopy_has_wildcards(src)) { + if ((options & NCOPY_OPT_S) && ncopy_is_dir(src) && !tool_has_wildcards(src)) { /* Novell NCOPY accepts a directory as the source root with /S. */ strmaxcpy(srcdir, src, sizeof(srcdir) - 1); strmaxcpy(pat, "*.*", sizeof(pat) - 1); diff --git a/ndir.c b/ndir.c index 77c20db..bf46bc8 100644 --- a/ndir.c +++ b/ndir.c @@ -646,14 +646,6 @@ static void ndir_effective_rights(char *path, char *out) } } -static int ndir_is_dot_dir(char *name) -{ - if (!name) return(0); - if (name[0] == '.' && name[1] == '\0') return(1); - if (name[0] == '.' && name[1] == '.' && name[2] == '\0') return(1); - return(0); -} - static void ndir_print_file(char *dir, NDIR_FIND_ENTRY *ent, int options, int *line_count, int *continuous) { @@ -796,7 +788,7 @@ static int ndir_collect_entries(char *dir, char *search, int want_dirs, _A_SYSTEM | _A_ARCH | _A_SUBDIR, &ff); while (rc == 0 && count < max_entries) { if (!!(ff.attrib & _A_SUBDIR) == !!want_dirs) { - if (!want_dirs || !ndir_is_dot_dir(ff.name)) { + if (!want_dirs || !tool_is_dot_dir(ff.name)) { list[count].ff = ff; ndir_fill_entry_info(dir, &list[count]); if (want_dirs) { @@ -1048,7 +1040,7 @@ static int ndir_spec_has_output(char *spec, int options) _A_SYSTEM | _A_ARCH | _A_SUBDIR, &ff); while (rc == 0) { if (ff.attrib & _A_SUBDIR) { - if (!ndir_is_dot_dir(ff.name) && !(options & NDIR_OPT_FILES_ONLY)) + if (!tool_is_dot_dir(ff.name) && !(options & NDIR_OPT_FILES_ONLY)) return(1); } else { if (!(options & NDIR_OPT_DIRS_ONLY)) @@ -1078,7 +1070,7 @@ static int ndir_list_subdirs(char *dir, char *pattern, int options, rc = _dos_findfirst(search, _A_NORMAL | _A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_ARCH | _A_SUBDIR, &ff); while (rc == 0) { - if ((ff.attrib & _A_SUBDIR) && !ndir_is_dot_dir(ff.name)) { + if ((ff.attrib & _A_SUBDIR) && !tool_is_dot_dir(ff.name)) { tool_join_path(subdir, dir, ff.name, sizeof(subdir)); tool_join_path(subspec, subdir, pattern, sizeof(subspec));