diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 08:29:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 08:29:09 +0000 |
commit | bc5ff99474cc1ca67c14471b8c95244542740ef8 (patch) | |
tree | 84917adb6e715184675c69737df07cdbdaeb0814 /dir.c | |
parent | e9bdbbdb755ee451302c3d834ad20f77d80754f0 (diff) |
2000-02-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -576,11 +576,11 @@ glob(path, func, arg) break; } magic = extract_elem(p); +#define BASE (*base && !(*base == '/' && !base[1])) + for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { if (fnmatch(magic, dp->d_name, FNM_PERIOD|FNM_PATHNAME) == 0) { char *fix = ALLOC_N(char, strlen(base)+NAMLEN(dp)+2); - #define BASE (*base && !(*base == '/' && !base[1])) - sprintf(fix, "%s%s%s", base, (BASE)?"/":"", dp->d_name); if (!m) { (*func)(fix, arg); |