summaryrefslogtreecommitdiffstats
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
commit9e997b5415c83d93fa6f053094ed887e9a41cfb3 (patch)
tree80c700c4fbfca0e04fec7bf7e1914b1340fc9012 /dir.c
parent4799437fc7e8e3d37853d280e6ee6f6323501586 (diff)
downloadruby-9e997b5415c83d93fa6f053094ed887e9a41cfb3.tar.gz
ruby-9e997b5415c83d93fa6f053094ed887e9a41cfb3.tar.xz
ruby-9e997b5415c83d93fa6f053094ed887e9a41cfb3.zip
* dir.c (range): use NULL instead of 0.
* dir.c (range): get rid of a gcc 3.4 warning. git-svn-id: http://svn.ruby-lang.org/repos/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 88fab2b48..51bc746b1 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;