summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-17 18:24:15 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-17 18:24:15 +0000
commita91e86dd1fcad9e94b5ecfde88afca6157add013 (patch)
tree80c700c4fbfca0e04fec7bf7e1914b1340fc9012 /dir.c
parent5d7d86d9366a53b6c970ebb7f57b168d05073031 (diff)
* dir.c (range): use NULL instead of 0.
* dir.c (range): get rid of a gcc 3.4 warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dir.c b/dir.c
index 88fab2b..51bc746 100644
--- a/dir.c
+++ b/dir.c
@@ -93,8 +93,8 @@ char *strchr _((char*,char));
static char *
range(pat, test, flags)
- char *pat;
- char test;
+ const char *pat;
+ int test;
int flags;
{
int not, ok = 0;
@@ -113,19 +113,19 @@ range(pat, test, flags)
pat++;
cstart = cend = *pat++;
if (!cstart)
- return 0;
+ return NULL;
if (*pat == '-' && pat[1] != ']') {
pat++;
if (escape && *pat == '\\')
pat++;
cend = *pat++;
if (!cend)
- return 0;
+ return NULL;
}
if (downcase(cstart) <= test && test <= downcase(cend))
ok = 1;
}
- return ok == not ? 0 : pat + 1;
+ return ok == not ? NULL : (char *)pat + 1;
}
#define ISDIRSEP(c) (pathname && isdirsep(c))
@@ -191,7 +191,7 @@ fnmatch(pat, string, flags)
if (!*s || ISDIRSEP(*s) || PERIOD(s))
return FNM_NOMATCH;
pat = range(pat, *s, flags);
- if (!pat)
+ if (pat == NULL)
return FNM_NOMATCH;
s++;
break;