find: estrdup before basename
"The basename() function may modify the string pointed to by path..." Thanks POSIX Laslo: Changed the style a bit
This commit is contained in:
committed by
Laslo Hunhold
parent
b7c73e2392
commit
0b27c0c9a0
@@ -229,7 +229,14 @@ static struct {
|
||||
static int
|
||||
pri_name(struct arg *arg)
|
||||
{
|
||||
return !fnmatch((char *)arg->extra.p, basename(arg->path), 0);
|
||||
int ret;
|
||||
char *path;
|
||||
|
||||
path = estrdup(arg->path);
|
||||
ret = !fnmatch((char *)arg->extra.p, basename(path), 0);
|
||||
free(path);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user