aboutsummaryrefslogtreecommitdiff
path: root/io/ftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/ftw.c')
-rw-r--r--io/ftw.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/io/ftw.c b/io/ftw.c
index 5495bc7..4138717 100644
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -1,5 +1,5 @@
/* File tree walker functions.
- Copyright (C) 1996-2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1996-2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -348,17 +348,8 @@ open_dir_stream (int *dfdp, struct ftw_data *data, struct dir_data *dirp)
}
else
{
- const char *name;
-
- if (data->flags & FTW_CHDIR)
- {
- name = data->dirbuf + data->ftw.base;
- if (name[0] == '\0')
- name = ".";
- }
- else
- name = data->dirbuf;
-
+ const char *name = ((data->flags & FTW_CHDIR)
+ ? data->dirbuf + data->ftw.base: data->dirbuf);
dirp->stream = __opendir (name);
}
@@ -730,16 +721,9 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
/* Get stat info for start directory. */
if (result == 0)
{
- const char *name;
-
- if (data.flags & FTW_CHDIR)
- {
- name = data.dirbuf + data.ftw.base;
- if (name[0] == '\0')
- name = ".";
- }
- else
- name = data.dirbuf;
+ const char *name = ((data.flags & FTW_CHDIR)
+ ? data.dirbuf + data.ftw.base
+ : data.dirbuf);
if (((flags & FTW_PHYS)
? LXSTAT (_STAT_VER, name, &st)