diff options
author | Nick Clifton <nickc@redhat.com> | 2017-06-23 10:22:36 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-06-23 10:24:39 +0100 |
commit | 0e158763b0c5671cd40cdd2faee48d6659489ddd (patch) | |
tree | df881f9e6ae267f58247c5aec5fe2820993ccb95 /binutils/strings.c | |
parent | 0dd5cbc56307afaf6a366a8e78ef25cf9cefe514 (diff) | |
download | gdb-0e158763b0c5671cd40cdd2faee48d6659489ddd.zip gdb-0e158763b0c5671cd40cdd2faee48d6659489ddd.tar.gz gdb-0e158763b0c5671cd40cdd2faee48d6659489ddd.tar.bz2 |
Make the strings utility reject directories.
PR binutils/21659
* strings.c (strings_file): Warn about attempts to run strings on
a directory.
Diffstat (limited to 'binutils/strings.c')
-rw-r--r-- | binutils/strings.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/binutils/strings.c b/binutils/strings.c index 13e2619..77d89eb 100644 --- a/binutils/strings.c +++ b/binutils/strings.c @@ -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 |