Noticed when looking into segfault. The "discarding const qualifier" warning always makes me worried as it tends to come from bad code. --- externs.h | 2 +- lib/glob/glob.c | 2 +- lib/sh/eaccess.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/externs.h b/externs.h index f2b43c415200..fa0603d34657 100644 --- a/externs.h +++ b/externs.h @@ -305,7 +305,7 @@ extern int sh_setlinebuf __P((FILE *)); #endif /* declarations for functions defined in lib/sh/shaccess.c */ -extern int sh_eaccess __P((char *, int)); +extern int sh_eaccess __P((const char *, int)); /* declarations for functions defined in lib/sh/shmatch.c */ extern int sh_regmatch __P((const char *, const char *, int)); diff --git a/lib/glob/glob.c b/lib/glob/glob.c index c6d7c05dca23..7f6eafe7d2eb 100644 --- a/lib/glob/glob.c +++ b/lib/glob/glob.c @@ -84,7 +84,7 @@ struct globval }; extern void throw_to_top_level __P((void)); -extern int sh_eaccess __P((char *, int)); +extern int sh_eaccess __P((const char *, int)); extern char *sh_makepath __P((const char *, const char *, int)); extern int signal_is_pending __P((int)); extern void run_pending_traps __P((void)); diff --git a/lib/sh/eaccess.c b/lib/sh/eaccess.c index 8132a9ab50de..8fd8a43e780d 100644 --- a/lib/sh/eaccess.c +++ b/lib/sh/eaccess.c @@ -53,9 +53,9 @@ extern int errno; #endif /* R_OK */ static int path_is_devfd __P((const char *)); -static int sh_stataccess __P((char *, int)); +static int sh_stataccess __P((const char *, int)); #if HAVE_DECL_SETREGID -static int sh_euidaccess __P((char *, int)); +static int sh_euidaccess __P((const char *, int)); #endif static int @@ -135,7 +135,7 @@ sh_stat (path, finfo) executable. This version uses stat(2). */ static int sh_stataccess (path, mode) - char *path; + const char *path; int mode; { struct stat st; @@ -172,7 +172,7 @@ sh_stataccess (path, mode) the effective and real uid and gid as appropriate. */ static int sh_euidaccess (path, mode) - char *path; + const char *path; int mode; { int r, e; @@ -197,7 +197,7 @@ sh_euidaccess (path, mode) int sh_eaccess (path, mode) - char *path; + const char *path; int mode; { int ret; -- 2.9.0