* cygcheck.cc (find_on_path): Create copy of rv on successful access

check, since rv can be reused in subsequent calls.
This commit is contained in:
Corinna Vinschen 2006-02-08 14:13:28 +00:00
parent 86fdf2166a
commit e699adfce5
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-02-08 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (find_on_path): Create copy of rv on successful access
check, since rv can be reused in subsequent calls.
2006-01-19 Christopher Faylor <cgf@timesys.com> 2006-01-19 Christopher Faylor <cgf@timesys.com>
* cygcheck.cc (common_paths): Add "patch". * cygcheck.cc (common_paths): Add "patch".

View File

@ -275,7 +275,7 @@ find_on_path (char *file, char *default_extension,
return fn; return fn;
strcpy (rv, fn); strcpy (rv, fn);
strcat (rv, default_extension); strcat (rv, default_extension);
return access (rv, F_OK) == 0 ? rv : fn; return access (rv, F_OK) == 0 ? strdup (rv) : fn;
} }
if (strchr (file, '.')) if (strchr (file, '.'))