From 0a5e41e80d9fb344f7bbcc1f44a061bbf9bd0242 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Mon, 8 Jul 2024 17:29:45 +0200 Subject: make wildmat arguments const --- src/include/wildmat.h | 2 +- src/wildmat.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/include/wildmat.h b/src/include/wildmat.h index 99b275b..f46d35b 100644 --- a/src/include/wildmat.h +++ b/src/include/wildmat.h @@ -1,6 +1,6 @@ #ifndef WILDMAT_H #define WILDMAT_H -extern int wildmat(char *, char *); +extern int wildmat(const char *, const char *); #endif diff --git a/src/wildmat.c b/src/wildmat.c index bcff8dd..8fe06da 100644 --- a/src/wildmat.c +++ b/src/wildmat.c @@ -37,6 +37,8 @@ * on. */ +#include "wildmat.h" + #define TRUE 1 #define FALSE 0 #define ABORT -1 @@ -51,7 +53,7 @@ /** * Match text and p, return TRUE, FALSE, or ABORT. */ -static int DoMatch(char *text, char *p) +static int DoMatch(const char *text, const char *p) { int last; int matched; @@ -93,7 +95,7 @@ static int DoMatch(char *text, char *p) /** * User-level routine. Returns TRUE or FALSE. */ -int wildmat(char *text, char *p) +int wildmat(const char *text, const char *p) { #ifdef OPTIMIZE_JUST_STAR if (p[0] == '*' && p[1] == '\0') return TRUE; -- cgit v1.2.3