diff options
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/client.c | 17 | ||||
-rw-r--r-- | source4/client/tree.c | 7 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source4/client/client.c b/source4/client/client.c index b016632fbd..4e84987b40 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -286,9 +286,9 @@ BOOL mask_match(struct smbcli_state *c, const char *string, const char *pattern, char *p2, *s2; BOOL ret; - if (strcmp(string,"..") == 0) + if (ISDOTDOT(string)) string = "."; - if (strcmp(pattern,".") == 0) + if (ISDOT(pattern)) return False; if (is_case_sensitive) @@ -497,8 +497,8 @@ static void do_list_helper(struct clilist_file_info *f, const char *mask, void * do_list_fn(ctx, f); } if (do_list_recurse && - !strequal(f->name,".") && - !strequal(f->name,"..")) { + !ISDOT(f->name) && + !ISDOTDOT(f->name)) { char *mask2; char *p; @@ -838,7 +838,7 @@ static void do_mget(struct smbclient_context *ctx, struct clilist_file_info *fin char *mget_mask; char *saved_curdir; - if (strequal(finfo->name,".") || strequal(finfo->name,"..")) + if (ISDOT(finfo->name) || ISDOTDOT(finfo->name)) return; if (finfo->attrib & FILE_ATTRIBUTE_DIRECTORY) @@ -1327,8 +1327,9 @@ static int file_find(struct smbclient_context *ctx, struct file_list **list, con if (!dir) return -1; while ((dname = readdirname(dir))) { - if (!strcmp("..", dname)) continue; - if (!strcmp(".", dname)) continue; + if (ISDOT(dname) || ISDOTDOT(dname)) { + continue; + } if (asprintf(&path, "%s/%s", directory, dname) <= 0) { continue; @@ -2725,7 +2726,7 @@ static void completion_remote_filter(struct clilist_file_info *f, const char *ma { completion_remote_t *info = (completion_remote_t *)state; - if ((info->count < MAX_COMPLETIONS - 1) && (strncmp(info->text, f->name, info->len) == 0) && (strcmp(f->name, ".") != 0) && (strcmp(f->name, "..") != 0)) { + if ((info->count < MAX_COMPLETIONS - 1) && (strncmp(info->text, f->name, info->len) == 0) && (!ISDOT(f->name)) && (!ISDOTDOT(f->name))) { if ((info->dirmask[0] == 0) && !(f->attrib & FILE_ATTRIBUTE_DIRECTORY)) info->matches[info->count] = strdup(f->name); else { diff --git a/source4/client/tree.c b/source4/client/tree.c index 9776ce2ef7..758bb1982a 100644 --- a/source4/client/tree.c +++ b/source4/client/tree.c @@ -239,8 +239,7 @@ static void cb_select_child (GtkWidget *root_tree, GtkWidget *child, /* Get stats on the file/dir and see what we have */ - if ((strcmp(dirp->name, ".") != 0) && - (strcmp(dirp->name, "..") != 0)) { + if (!ISDOT(dirp->name) && !ISDOTDOT(dirp->name)) { strncpy(path1, path, sizeof(path1)); strncat(path1, "/", sizeof(path) - strlen(path)); @@ -414,8 +413,8 @@ static void cb_itemsignal( GtkWidget *item, if (dirp->smbc_type != SMBC_FILE && dirp->smbc_type != SMBC_IPC_SHARE && - (strcmp(dirp->name, ".") != 0) && - (strcmp(dirp->name, "..") !=0)){ + (!ISDOT(dirp->name)) && + (!ISDOTDOT(dirp->name))){ subtree = gtk_tree_new(); gtk_tree_item_set_subtree(GTK_TREE_ITEM(aitem), subtree); |