summaryrefslogtreecommitdiffstats
path: root/source/lib/ms_fnmatch.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-30 11:25:09 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-30 11:25:09 +0000
commit95f6c0f84ab9f3649ddf53ac2ca5261448af2383 (patch)
tree38036073622a2420ad3ba7b34aba1e4184cf05b6 /source/lib/ms_fnmatch.c
parente23f43e7d3d2a068f527baa63a31f7fe4e60e79d (diff)
downloadsamba-95f6c0f84ab9f3649ddf53ac2ca5261448af2383.tar.gz
samba-95f6c0f84ab9f3649ddf53ac2ca5261448af2383.tar.xz
samba-95f6c0f84ab9f3649ddf53ac2ca5261448af2383.zip
some cleanups
Diffstat (limited to 'source/lib/ms_fnmatch.c')
-rw-r--r--source/lib/ms_fnmatch.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source/lib/ms_fnmatch.c b/source/lib/ms_fnmatch.c
index d9475cb6ef4..ee9b1cf985e 100644
--- a/source/lib/ms_fnmatch.c
+++ b/source/lib/ms_fnmatch.c
@@ -1,14 +1,9 @@
/*
Unix SMB/Netbios implementation.
Version 3.0
-
+ filename matching routine
Copyright (C) Andrew Tridgell 1992-1998
- This module is derived from fnmatch.c copyright by the Free
- Software Foundation. It has been extensively modified to implement
- the wildcard matcing semantics of Microsoft SMB servers.
-
-
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -23,8 +18,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/*
+ This module was originally based on fnmatch.c copyright by the Free
+ Software Foundation. It bears little resemblence to that code now
+*/
+
-/* this matches only filenames, with no directory component */
#if FNMATCH_TEST
#include <stdio.h>
#include <stdlib.h>
@@ -34,7 +33,10 @@
/* the following function was derived using the masktest utility -
after years of effort we finally have a perfect MS wildcard
- matching routine! */
+ matching routine!
+
+ NOTE: this matches only filenames with no directory component
+*/
int ms_fnmatch(char *pattern, char *string)
{
char *p = pattern, *n = string;
@@ -85,7 +87,7 @@ int ms_fnmatch(char *pattern, char *string)
}
}
- if (! *n) return 0;
+ if (! *n) return 0;
return -1;
}
@@ -143,4 +145,5 @@ static char *match_test(char *pattern, char *file, char *short_name)
}
return 0;
}
-#endif
+#endif /* FNMATCH_TEST */
+