]> granicus.if.org Git - sudo/commitdiff
Resolve namespace collisions on HP-UX ia64 and possibly others by
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 May 2011 17:45:56 +0000 (13:45 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 May 2011 17:45:56 +0000 (13:45 -0400)
adding a rpl_ prefix to our fnmatch and glob replacements and
#defining rpl_foo to foo in the header files.

compat/fnmatch.c
compat/fnmatch.h
compat/glob.c
compat/glob.h

index 3bc92d3bee22d88ea4825d81132e486b8d5d9307..91ef81476a9d9f891a57189d3866528af369b753 100644 (file)
@@ -68,7 +68,7 @@ static int rangematch(const char *, int, int, char **);
 static int classmatch(const char *, int, int, const char **);
 
 int
-fnmatch(const char *pattern, const char *string, int flags)
+rpl_fnmatch(const char *pattern, const char *string, int flags)
 {
        const char *stringstart;
        char *newp;
index 5b6029394b31b37b2fada534c0ad0b68e3b99bd6..2c310796d547a76f1949856a2b4a9f3249c2a0e7 100644 (file)
@@ -41,6 +41,8 @@
 #define        FNM_LEADING_DIR 0x08    /* Ignore /<tail> after Imatch. */
 #define        FNM_CASEFOLD    0x10    /* Case insensitive search. */
 
+#define fnmatch(_a, _b, _c)    rpl_fnmatch((_a), (_b), (_c))
+
 int     fnmatch(const char *, const char *, int);
 
 #endif /* !_FNMATCH_H_ */
index a46ae9d7e13f24777f1abb5d111388fcdbf01e20..cf9a4e2bf66efaa427d84e528e2d92a33167c755 100644 (file)
@@ -174,7 +174,7 @@ static void  qprintf(const char *, Char *);
 #endif
 
 int
-glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
+rpl_glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
        glob_t *pglob)
 {
        const unsigned char *patnext;
@@ -810,7 +810,7 @@ match(Char *name, Char *pat, Char *patend)
 
 /* Free allocated data belonging to a glob_t structure. */
 void
-globfree(glob_t *pglob)
+rpl_globfree(glob_t *pglob)
 {
        int i;
        char **pp;
index 4b59b4e3cd8845202fe4fa85312bf6b3f1384391..8279b796c81d7b19c5f2d84ea860e8502a623266 100644 (file)
@@ -69,6 +69,9 @@ typedef struct {
 #define        GLOB_NOSYS      (-4)    /* Function not supported. */
 #define GLOB_ABEND     GLOB_ABORTED
 
+#define glob(_a, _b, _c, _d) rpl_glob((_a), (_b), (_c), (_d))
+#define globfree(_a) rpl_globfree((_a))
+
 int    glob(const char *, int, int (*)(const char *, int), glob_t *);
 void   globfree(glob_t *);