Blame SOURCES/unzip-6.0-fix-recmatch.patch

1ed299
diff -up unzip60/match.c.recmatch unzip60/match.c
1ed299
--- unzip60/match.c.recmatch	2005-08-14 13:00:36.000000000 -0400
1ed299
+++ unzip60/match.c	2013-05-28 10:29:57.949077543 -0400
1ed299
@@ -27,16 +27,14 @@
1ed299
 
1ed299
   ---------------------------------------------------------------------------
1ed299
 
1ed299
-  Copyright on recmatch() from Zip's util.c (although recmatch() was almost
1ed299
-  certainly written by Mark Adler...ask me how I can tell :-) ):
1ed299
+  Copyright on recmatch() from Zip's util.c
1ed299
+	 Copyright (c) 1990-2005 Info-ZIP.  All rights reserved.
1ed299
 
1ed299
-     Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly,
1ed299
-     Kai Uwe Rommel and Igor Mandrichenko.
1ed299
+	 See the accompanying file LICENSE, version 2004-May-22 or later
1ed299
+	 for terms of use.
1ed299
+	 If, for some reason, both of these files are missing, the Info-ZIP license
1ed299
+	 also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html  
1ed299
 
1ed299
-     Permission is granted to any individual or institution to use, copy,
1ed299
-     or redistribute this software so long as all of the original files are
1ed299
-     included unmodified, that it is not sold for profit, and that this copy-
1ed299
-     right notice is retained.
1ed299
 
1ed299
   ---------------------------------------------------------------------------
1ed299
 
1ed299
@@ -53,7 +51,7 @@
1ed299
 
1ed299
   A set is composed of characters or ranges; a range looks like ``character
1ed299
   hyphen character'' (as in 0-9 or A-Z).  [0-9a-zA-Z_] is the minimal set of
1ed299
-  characters allowed in the [..] pattern construct.  Other characters are
1ed299
+  characters ALlowed in the [..] pattern construct.  Other characters are
1ed299
   allowed (i.e., 8-bit characters) if your system will support them.
1ed299
 
1ed299
   To suppress the special syntactic significance of any of ``[]*?!^-\'', in-
1ed299
@@ -101,8 +99,32 @@
1ed299
 #  define WILDCHAR   '?'
1ed299
 #  define BEG_RANGE  '['
1ed299
 #  define END_RANGE  ']'
1ed299
+#  define WILDCHR_SINGLE '?'
1ed299
+#  define DIRSEP_CHR '/'
1ed299
+#  define WILDCHR_MULTI '*'
1ed299
 #endif
1ed299
 
1ed299
+#ifdef WILD_STOP_AT_DIR
1ed299
+   int wild_stop_at_dir = 1; /* default wildcards do not include / in matches */
1ed299
+#else
1ed299
+   int wild_stop_at_dir = 0; /* default wildcards do include / in matches */
1ed299
+#endif
1ed299
+
1ed299
+
1ed299
+
1ed299
+/*
1ed299
+ * case mapping functions. case_map is used to ignore case in comparisons,
1ed299
+ * to_up is used to force upper case even on Unix (for dosify option).
1ed299
+ */
1ed299
+#ifdef USE_CASE_MAP
1ed299
+#  define case_map(c) upper[(c) & 0xff]
1ed299
+#  define to_up(c)    upper[(c) & 0xff]
1ed299
+#else
1ed299
+#  define case_map(c) (c)
1ed299
+#  define to_up(c)    ((c) >= 'a' && (c) <= 'z' ? (c)-'a'+'A' : (c))
1ed299
+#endif /* USE_CASE_MAP */
1ed299
+
1ed299
+
1ed299
 #if 0                /* GRR:  add this to unzip.h someday... */
1ed299
 #if !(defined(MSDOS) && defined(DOSWILD))
1ed299
 #ifdef WILD_STOP_AT_DIR
1ed299
@@ -114,8 +136,8 @@ int recmatch OF((ZCONST uch *pattern, ZC
1ed299
                  int ignore_case __WDLPRO));
1ed299
 #endif
1ed299
 #endif /* 0 */
1ed299
-static int recmatch OF((ZCONST uch *pattern, ZCONST uch *string,
1ed299
-                        int ignore_case __WDLPRO));
1ed299
+static int recmatch OF((ZCONST char *, ZCONST char *, 
1ed299
+                        int));
1ed299
 static char *isshexp OF((ZCONST char *p));
1ed299
 static int namecmp OF((ZCONST char *s1, ZCONST char *s2));
1ed299
 
1ed299
@@ -154,192 +176,240 @@ int match(string, pattern, ignore_case _
1ed299
             }
1ed299
             dospattern[j-1] = '\0';                    /* nuke the end "." */
1ed299
         }
1ed299
-        j = recmatch((uch *)dospattern, (uch *)string, ignore_case __WDL);
1ed299
+        j = recmatch(dospattern, string, ignore_case);
1ed299
         free(dospattern);
1ed299
         return j == 1;
1ed299
     } else
1ed299
 #endif /* MSDOS && DOSWILD */
1ed299
-    return recmatch((uch *)pattern, (uch *)string, ignore_case __WDL) == 1;
1ed299
+    return recmatch(pattern, string, ignore_case) == 1;
1ed299
 }
1ed299
 
1ed299
+#ifdef _MBCS
1ed299
+
1ed299
+char *___tmp_ptr;
1ed299
 
1ed299
+#endif
1ed299
 
1ed299
-static int recmatch(p, s, ic __WDL)
1ed299
-    ZCONST uch *p;        /* sh pattern to match */
1ed299
-    ZCONST uch *s;        /* string to which to match it */
1ed299
-    int ic;               /* true for case insensitivity */
1ed299
-    __WDLDEF              /* directory sepchar for WildStopAtDir mode, or 0 */
1ed299
+static int recmatch(p, s, cs)
1ed299
+ZCONST char *p;         /* sh pattern to match */
1ed299
+ZCONST char *s;         /* string to match it to */
1ed299
+int cs;                 /* flag: force case-sensitive matching */
1ed299
 /* Recursively compare the sh pattern p with the string s and return 1 if
1ed299
- * they match, and 0 or 2 if they don't or if there is a syntax error in the
1ed299
- * pattern.  This routine recurses on itself no more deeply than the number
1ed299
- * of characters in the pattern. */
1ed299
+   they match, and 0 or 2 if they don't or if there is a syntax error in the
1ed299
+   pattern.  This routine recurses on itself no deeper than the number of
1ed299
+   characters in the pattern. */
1ed299
 {
1ed299
-    unsigned int c;       /* pattern char or start of range in [-] loop */
1ed299
+  int c;                /* pattern char or start of range in [-] loop */
1ed299
+  /* Get first character, the pattern for new recmatch calls follows */
1ed299
+ /* borrowed from Zip's global.c */
1ed299
+ int no_wild = 0; 
1ed299
+ int allow_regex=1;
1ed299
+  /* This fix provided by akt@m5.dion.ne.jp for Japanese.
1ed299
+     See 21 July 2006 mail.
1ed299
+     It only applies when p is pointing to a doublebyte character and
1ed299
+     things like / and wildcards are not doublebyte.  This probably
1ed299
+     should not be needed. */
1ed299
 
1ed299
-    /* Get first character, the pattern for new recmatch calls follows */
1ed299
-    c = *p; INCSTR(p);
1ed299
+#ifdef _MBCS
1ed299
+  if (CLEN(p) == 2) {
1ed299
+    if (CLEN(s) == 2) {
1ed299
+      return (*p == *s && *(p+1) == *(s+1)) ?
1ed299
+        recmatch(p + 2, s + 2, cs) : 0;
1ed299
+    } else {
1ed299
+      return 0;
1ed299
+    }
1ed299
+  }
1ed299
+#endif /* ?_MBCS */
1ed299
 
1ed299
-    /* If that was the end of the pattern, match if string empty too */
1ed299
-    if (c == 0)
1ed299
-        return *s == 0;
1ed299
+  c = *POSTINCSTR(p);
1ed299
 
1ed299
-    /* '?' (or '%') matches any character (but not an empty string). */
1ed299
-    if (c == WILDCHAR)
1ed299
-#ifdef WILD_STOP_AT_DIR
1ed299
-        /* If uO.W_flag is non-zero, it won't match '/' */
1ed299
-        return (*s && (!sepc || *s != (uch)sepc))
1ed299
-               ? recmatch(p, s + CLEN(s), ic, sepc) : 0;
1ed299
-#else
1ed299
-        return *s ? recmatch(p, s + CLEN(s), ic) : 0;
1ed299
-#endif
1ed299
+  /* If that was the end of the pattern, match if string empty too */
1ed299
+  if (c == 0)
1ed299
+    return *s == 0;
1ed299
+
1ed299
+  /* '?' (or '%' or '#') matches any character (but not an empty string) */
1ed299
+  if (c == WILDCHR_SINGLE) {
1ed299
+    if (wild_stop_at_dir)
1ed299
+      return (*s && *s != DIRSEP_CHR) ? recmatch(p, s + CLEN(s), cs) : 0;
1ed299
+    else
1ed299
+      return *s ? recmatch(p, s + CLEN(s), cs) : 0;
1ed299
+  }
1ed299
 
1ed299
-    /* '*' matches any number of characters, including zero */
1ed299
+  /* WILDCHR_MULTI ('*') matches any number of characters, including zero */
1ed299
 #ifdef AMIGA
1ed299
-    if (c == '#' && *p == '?')     /* "#?" is Amiga-ese for "*" */
1ed299
-        c = '*', p++;
1ed299
+  if (!no_wild && c == '#' && *p == '?')            /* "#?" is Amiga-ese for "*" */
1ed299
+    c = WILDCHR_MULTI, p++;
1ed299
 #endif /* AMIGA */
1ed299
-    if (c == '*') {
1ed299
-#ifdef WILD_STOP_AT_DIR
1ed299
-        if (sepc) {
1ed299
-          /* check for single "*" or double "**" */
1ed299
-#  ifdef AMIGA
1ed299
-          if ((c = p[0]) == '#' && p[1] == '?') /* "#?" is Amiga-ese for "*" */
1ed299
-            c = '*', p++;
1ed299
-          if (c != '*') {
1ed299
-#  else /* !AMIGA */
1ed299
-          if (*p != '*') {
1ed299
-#  endif /* ?AMIGA */
1ed299
-            /* single "*": this doesn't match the dirsep character */
1ed299
-            for (; *s && *s != (uch)sepc; INCSTR(s))
1ed299
-                if ((c = recmatch(p, s, ic, sepc)) != 0)
1ed299
-                    return (int)c;
1ed299
-            /* end of pattern: matched if at end of string, else continue */
1ed299
-            if (*p == '\0')
1ed299
-                return (*s == 0);
1ed299
-            /* continue to match if at sepc in pattern, else give up */
1ed299
-            return (*p == (uch)sepc || (*p == '\\' && p[1] == (uch)sepc))
1ed299
-                   ? recmatch(p, s, ic, sepc) : 2;
1ed299
-          }
1ed299
-          /* "**": this matches slashes */
1ed299
-          ++p;        /* move p behind the second '*' */
1ed299
-          /* and continue with the non-W_flag code variant */
1ed299
-        }
1ed299
-#endif /* WILD_STOP_AT_DIR */
1ed299
+  if (!no_wild && c == WILDCHR_MULTI)
1ed299
+  {
1ed299
+    if (wild_stop_at_dir) {
1ed299
+      /* Check for an immediately following WILDCHR_MULTI */
1ed299
+# ifdef AMIGA
1ed299
+      if ((c = p[0]) == '#' && p[1] == '?') /* "#?" is Amiga-ese for "*" */
1ed299
+        c = WILDCHR_MULTI, p++;
1ed299
+      if (c != WILDCHR_MULTI) {
1ed299
+# else /* !AMIGA */
1ed299
+      if (*p != WILDCHR_MULTI) {
1ed299
+# endif /* ?AMIGA */
1ed299
+        /* Single WILDCHR_MULTI ('*'): this doesn't match slashes */
1ed299
+        for (; *s && *s != DIRSEP_CHR; INCSTR(s))
1ed299
+          if ((c = recmatch(p, s, cs)) != 0)
1ed299
+            return c;
1ed299
+        /* end of pattern: matched if at end of string, else continue */
1ed299
         if (*p == 0)
1ed299
-            return 1;
1ed299
-        if (isshexp((ZCONST char *)p) == NULL) {
1ed299
-            /* Optimization for rest of pattern being a literal string:
1ed299
-             * If there are no other shell expression chars in the rest
1ed299
-             * of the pattern behind the multi-char wildcard, then just
1ed299
-             * compare the literal string tail.
1ed299
-             */
1ed299
-            ZCONST uch *srest;
1ed299
-
1ed299
-            srest = s + (strlen((ZCONST char *)s) - strlen((ZCONST char *)p));
1ed299
-            if (srest - s < 0)
1ed299
-                /* remaining literal string from pattern is longer than rest
1ed299
-                 * of test string, there can't be a match
1ed299
-                 */
1ed299
-                return 0;
1ed299
-            else
1ed299
-              /* compare the remaining literal pattern string with the last
1ed299
-               * bytes of the test string to check for a match
1ed299
-               */
1ed299
+          return (*s == 0);
1ed299
+        /* continue to match if at DIRSEP_CHR in pattern, else give up */
1ed299
+        return (*p == DIRSEP_CHR || (*p == '\\' && p[1] == DIRSEP_CHR))
1ed299
+               ? recmatch(p, s, cs) : 2;
1ed299
+      }
1ed299
+      /* Two consecutive WILDCHR_MULTI ("**"): this matches DIRSEP_CHR ('/') */
1ed299
+      p++;        /* move p past the second WILDCHR_MULTI */
1ed299
+      /* continue with the normal non-WILD_STOP_AT_DIR code */
1ed299
+    } /* wild_stop_at_dir */
1ed299
+
1ed299
+    /* Not wild_stop_at_dir */
1ed299
+    if (*p == 0)
1ed299
+      return 1;
1ed299
+    if (!isshexp((char *)p))
1ed299
+    {
1ed299
+      /* optimization for rest of pattern being a literal string */
1ed299
+
1ed299
+      /* optimization to handle patterns like *.txt */
1ed299
+      /* if the first char in the pattern is '*' and there */
1ed299
+      /* are no other shell expression chars, i.e. a literal string */
1ed299
+      /* then just compare the literal string at the end */
1ed299
+
1ed299
+      ZCONST char *srest;
1ed299
+
1ed299
+      srest = s + (strlen(s) - strlen(p));
1ed299
+      if (srest - s < 0)
1ed299
+        /* remaining literal string from pattern is longer than rest of
1ed299
+           test string, there can't be a match
1ed299
+         */
1ed299
+        return 0;
1ed299
+      else
1ed299
+        /* compare the remaining literal pattern string with the last bytes
1ed299
+           of the test string to check for a match */
1ed299
 #ifdef _MBCS
1ed299
-            {
1ed299
-                ZCONST uch *q = s;
1ed299
+      {
1ed299
+        ZCONST char *q = s;
1ed299
 
1ed299
-                /* MBCS-aware code must not scan backwards into a string from
1ed299
-                 * the end.
1ed299
-                 * So, we have to move forward by character from our well-known
1ed299
-                 * character position s in the test string until we have
1ed299
-                 * advanced to the srest position.
1ed299
-                 */
1ed299
-                while (q < srest)
1ed299
-                  INCSTR(q);
1ed299
-                /* In case the byte *srest is a trailing byte of a multibyte
1ed299
-                 * character in the test string s, we have actually advanced
1ed299
-                 * past the position (srest).
1ed299
-                 * For this case, the match has failed!
1ed299
-                 */
1ed299
-                if (q != srest)
1ed299
-                    return 0;
1ed299
-                return ((ic
1ed299
-                         ? namecmp((ZCONST char *)p, (ZCONST char *)q)
1ed299
-                         : strcmp((ZCONST char *)p, (ZCONST char *)q)
1ed299
-                        ) == 0);
1ed299
-            }
1ed299
+        /* MBCS-aware code must not scan backwards into a string from
1ed299
+         * the end.
1ed299
+         * So, we have to move forward by character from our well-known
1ed299
+         * character position s in the test string until we have advanced
1ed299
+         * to the srest position.
1ed299
+         */
1ed299
+        while (q < srest)
1ed299
+          INCSTR(q);
1ed299
+        /* In case the byte *srest is a trailing byte of a multibyte
1ed299
+         * character, we have actually advanced past the position (srest).
1ed299
+         * For this case, the match has failed!
1ed299
+         */
1ed299
+        if (q != srest)
1ed299
+          return 0;
1ed299
+        return ((cs ? strcmp(p, q) : namecmp(p, q)) == 0);
1ed299
+      }
1ed299
 #else /* !_MBCS */
1ed299
-                return ((ic
1ed299
-                         ? namecmp((ZCONST char *)p, (ZCONST char *)srest)
1ed299
-                         : strcmp((ZCONST char *)p, (ZCONST char *)srest)
1ed299
-                        ) == 0);
1ed299
+        return ((cs ? strcmp(p, srest) : namecmp(p, srest)) == 0);
1ed299
 #endif /* ?_MBCS */
1ed299
-        } else {
1ed299
-            /* pattern contains more wildcards, continue with recursion... */
1ed299
-            for (; *s; INCSTR(s))
1ed299
-                if ((c = recmatch(p, s, ic __WDL)) != 0)
1ed299
-                    return (int)c;
1ed299
-            return 2;  /* 2 means give up--match will return false */
1ed299
-        }
1ed299
     }
1ed299
-
1ed299
-    /* Parse and process the list of characters and ranges in brackets */
1ed299
-    if (c == BEG_RANGE) {
1ed299
-        int e;          /* flag true if next char to be taken literally */
1ed299
-        ZCONST uch *q;  /* pointer to end of [-] group */
1ed299
-        int r;          /* flag true to match anything but the range */
1ed299
-
1ed299
-        if (*s == 0)                            /* need a character to match */
1ed299
-            return 0;
1ed299
-        p += (r = (*p == '!' || *p == '^'));    /* see if reverse */
1ed299
-        for (q = p, e = 0; *q; INCSTR(q))       /* find closing bracket */
1ed299
-            if (e)
1ed299
-                e = 0;
1ed299
-            else
1ed299
-                if (*q == '\\')      /* GRR:  change to ^ for MS-DOS, OS/2? */
1ed299
-                    e = 1;
1ed299
-                else if (*q == END_RANGE)
1ed299
-                    break;
1ed299
-        if (*q != END_RANGE)         /* nothing matches if bad syntax */
1ed299
-            return 0;
1ed299
-        for (c = 0, e = (*p == '-'); p < q; INCSTR(p)) {
1ed299
-            /* go through the list */
1ed299
-            if (!e && *p == '\\')               /* set escape flag if \ */
1ed299
-                e = 1;
1ed299
-            else if (!e && *p == '-')           /* set start of range if - */
1ed299
-                c = *(p-1);
1ed299
-            else {
1ed299
-                unsigned int cc = Case(*s);
1ed299
-
1ed299
-                if (*(p+1) != '-')
1ed299
-                    for (c = c ? c : *p; c <= *p; c++)  /* compare range */
1ed299
-                        if ((unsigned)Case(c) == cc) /* typecast for MSC bug */
1ed299
-                            return r ? 0 : recmatch(q + 1, s + 1, ic __WDL);
1ed299
-                c = e = 0;   /* clear range, escape flags */
1ed299
-            }
1ed299
-        }
1ed299
-        return r ? recmatch(q + CLEN(q), s + CLEN(s), ic __WDL) : 0;
1ed299
-                                        /* bracket match failed */
1ed299
+    else
1ed299
+    {
1ed299
+      /* pattern contains more wildcards, continue with recursion... */
1ed299
+      for (; *s; INCSTR(s))
1ed299
+        if ((c = recmatch(p, s, cs)) != 0)
1ed299
+          return c;
1ed299
+      return 2;           /* 2 means give up--shmatch will return false */
1ed299
     }
1ed299
+  }
1ed299
 
1ed299
-    /* if escape ('\\'), just compare next character */
1ed299
-    if (c == '\\' && (c = *p++) == 0)     /* if \ at end, then syntax error */
1ed299
-        return 0;
1ed299
+#ifndef VMS             /* No bracket matching in VMS */
1ed299
+  /* Parse and process the list of characters and ranges in brackets */
1ed299
+  if (!no_wild && allow_regex && c == '[')
1ed299
+  {
1ed299
+    int e;              /* flag true if next char to be taken literally */
1ed299
+    ZCONST char *q;     /* pointer to end of [-] group */
1ed299
+    int r;              /* flag true to match anything but the range */
1ed299
+
1ed299
+    if (*s == 0)                        /* need a character to match */
1ed299
+      return 0;
1ed299
+    p += (r = (*p == '!' || *p == '^')); /* see if reverse */
1ed299
+    for (q = p, e = 0; *q; q++)         /* find closing bracket */
1ed299
+      if (e)
1ed299
+        e = 0;
1ed299
+      else
1ed299
+        if (*q == '\\')
1ed299
+          e = 1;
1ed299
+        else if (*q == ']')
1ed299
+          break;
1ed299
+    if (*q != ']')                      /* nothing matches if bad syntax */
1ed299
+      return 0;
1ed299
+    for (c = 0, e = *p == '-'; p < q; p++)      /* go through the list */
1ed299
+    {
1ed299
+      if (e == 0 && *p == '\\')         /* set escape flag if \ */
1ed299
+        e = 1;
1ed299
+      else if (e == 0 && *p == '-')     /* set start of range if - */
1ed299
+        c = *(p-1);
1ed299
+      else
1ed299
+      {
1ed299
+        uch cc = (cs ? (uch)*s : case_map((uch)*s));
1ed299
+        uch uc = (uch) c;
1ed299
+        if (*(p+1) != '-')
1ed299
+          for (uc = uc ? uc : (uch)*p; uc <= (uch)*p; uc++)
1ed299
+            /* compare range */
1ed299
+            if ((cs ? uc : case_map(uc)) == cc)
1ed299
+              return r ? 0 : recmatch(q + CLEN(q), s + CLEN(s), cs);
1ed299
+        c = e = 0;                      /* clear range, escape flags */
1ed299
+      }
1ed299
+    }
1ed299
+    return r ? recmatch(q + CLEN(q), s + CLEN(s), cs) : 0;
1ed299
+                                        /* bracket match failed */
1ed299
+  }
1ed299
+#endif /* !VMS */
1ed299
 
1ed299
-    /* just a character--compare it */
1ed299
-#ifdef QDOS
1ed299
-    return QMatch(Case((uch)c), Case(*s)) ?
1ed299
-           recmatch(p, s + CLEN(s), ic __WDL) : 0;
1ed299
-#else
1ed299
-    return Case((uch)c) == Case(*s) ?
1ed299
-           recmatch(p, s + CLEN(s), ic __WDL) : 0;
1ed299
-#endif
1ed299
+  /* If escape ('\'), just compare next character */
1ed299
+  if (!no_wild && c == '\\')
1ed299
+    if ((c = *p++) == '\0')             /* if \ at end, then syntax error */
1ed299
+      return 0;
1ed299
+
1ed299
+#ifdef VMS
1ed299
+  /* 2005-11-06 SMS.
1ed299
+     Handle "..." wildcard in p with "." or "]" in s.
1ed299
+  */
1ed299
+  if ((c == '.') && (*p == '.') && (*(p+ CLEN( p)) == '.') &&
1ed299
+   ((*s == '.') || (*s == ']')))
1ed299
+  {
1ed299
+    /* Match "...]" with "]".  Continue after "]" in both. */
1ed299
+    if ((*(p+ 2* CLEN( p)) == ']') && (*s == ']'))
1ed299
+      return recmatch( (p+ 3* CLEN( p)), (s+ CLEN( s)), cs);
1ed299
+
1ed299
+    /* Else, look for a reduced match in s, until "]" in or end of s. */
1ed299
+    for (; *s && (*s != ']'); INCSTR(s))
1ed299
+      if (*s == '.')
1ed299
+        /* If reduced match, then continue after "..." in p, "." in s. */
1ed299
+        if ((c = recmatch( (p+ CLEN( p)), s, cs)) != 0)
1ed299
+          return (int)c;
1ed299
+
1ed299
+    /* Match "...]" with "]".  Continue after "]" in both. */
1ed299
+    if ((*(p+ 2* CLEN( p)) == ']') && (*s == ']'))
1ed299
+      return recmatch( (p+ 3* CLEN( p)), (s+ CLEN( s)), cs);
1ed299
+
1ed299
+    /* No reduced match.  Quit. */
1ed299
+    return 2;
1ed299
+  }
1ed299
+
1ed299
+#endif /* def VMS */
1ed299
+
1ed299
+  /* Just a character--compare it */
1ed299
+  return (cs ? c == *s : case_map((uch)c) == case_map((uch)*s)) ?
1ed299
+          recmatch(p, s + CLEN(s), cs) : 0;
1ed299
+}
1ed299
 
1ed299
-} /* end function recmatch() */
1ed299
 
1ed299
 
1ed299
 
1ed299
+/*************************************************************************************************/
1ed299
 static char *isshexp(p)
1ed299
 ZCONST char *p;
1ed299
 /* If p is a sh expression, a pointer to the first special character is