Fix const qualifier discarded warnings in dirlist_add_subdir() and
lookup() functions. These warnings are reported by gcc 15 which
defaults to the C23 standard.
The strchr() and strrchr() functions return pointers into const strings,
so the receiving variables must be declared as const char *.
Signed-off-by: Karel Zak <kzak@redhat.com>
char buf[PATH_MAX], *d;
DIR *dirp;
struct dirent *dp;
- char *postfix;
+ const char *postfix;
size_t len;
postfix = strchr(dir, '*');
{
char patbuf[PATH_MAX] = { 0 };
int count = 0;
- char *wait = NULL, *p;
+ char *wait = NULL;
+ const char *p;
/* canonicalize pattern -- remove path suffix etc. */
p = strrchr(pattern, '/');
- p = p ? p + 1 : (char *) pattern;
+ p = p ? p + 1 : pattern;
xstrncpy(patbuf, p, PATH_MAX);
DBG(SEARCH, ul_debug("lookup dirs for '%s' (%s), want: %s %s %s",