aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-06-03 23:24:13 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-06-03 23:24:13 +0300
commitb466be3fb90761db98c7f7585a6e885dcf8bd6fc (patch)
tree4c21e993e14bd4faa15e6968825e043be21adef1
parent553855793b8b92de4f764a36911118865c4f00e2 (diff)
downloadrush-b466be3fb90761db98c7f7585a6e885dcf8bd6fc.tar.gz
rush-b466be3fb90761db98c7f7585a6e885dcf8bd6fc.tar.bz2
Minor fix
* lib/librush.h (wildmatch): Both string arguments are constant. * lib/wildmatch.c: Likewise.
-rw-r--r--lib/librush.h2
-rw-r--r--lib/wildmatch.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/librush.h b/lib/librush.h
index b819a1e..de73529 100644
--- a/lib/librush.h
+++ b/lib/librush.h
@@ -154,4 +154,4 @@ const char *user_gettext(const char *locale, const char *domain,
void argcv_free(int argc, char **argv);
char *argcv_string(int argc, char **argv);
-int wildmatch(char *expr, char *name, size_t len);
+int wildmatch(char const *expr, char const *name, size_t len);
diff --git a/lib/wildmatch.c b/lib/wildmatch.c
index 9e8f6d5..e35b7da 100644
--- a/lib/wildmatch.c
+++ b/lib/wildmatch.c
@@ -23,11 +23,11 @@ enum {
};
static int
-match_char_class(char **pexpr, char c)
+match_char_class(char const **pexpr, char c)
{
int res;
int rc;
- char *expr = *pexpr;
+ char const *expr = *pexpr;
expr++;
if (*expr == '^') {
@@ -65,7 +65,7 @@ match_char_class(char **pexpr, char c)
#define NEXT_CHAR(s,l) (s++, l--)
int
-wilder_match(char *expr, char *name, size_t len)
+wilder_match(char const *expr, char const *name, size_t len)
{
int c;
@@ -119,7 +119,7 @@ wilder_match(char *expr, char *name, size_t len)
/* Return 0 if first LEN bytes of NAME match globbing pattern EXPR. */
int
-wildmatch(char *expr, char *name, size_t len)
+wildmatch(char const *expr, char const *name, size_t len)
{
return wilder_match(expr, name, len) != WILD_TRUE;
}

Return to:

Send suggestions and report system problems to the System administrator.