Make the strings utility reject directories.
PR binutils/21659 * strings.c (strings_file): Warn about attempts to run strings on a directory.
This commit is contained in:
parent
0dd5cbc563
commit
0e158763b0
2 changed files with 11 additions and 0 deletions
|
@ -446,6 +446,11 @@ strings_file (char *file)
|
|||
file, strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
else if (S_ISDIR (st.st_mode))
|
||||
{
|
||||
non_fatal (_("Warning: '%s' is a directory"), file);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* If we weren't told to scan the whole file,
|
||||
try to open it as an object file and only look at
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue