aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-proc.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2002-03-25 19:47:41 +0000
committerMichael Snyder <msnyder@vmware.com>2002-03-25 19:47:41 +0000
commitee677e8d79bc3a816f028ac6ed51f1a2bbc13b96 (patch)
treec62ee91e1e273d8506aa23f2edd20b8c226d52bf /gdb/linux-proc.c
parente76e1718ebd4ce4083be216b8dd1ee8c849dd956 (diff)
downloadgdb-ee677e8d79bc3a816f028ac6ed51f1a2bbc13b96.zip
gdb-ee677e8d79bc3a816f028ac6ed51f1a2bbc13b96.tar.gz
gdb-ee677e8d79bc3a816f028ac6ed51f1a2bbc13b96.tar.bz2
2002-03-25 Jeff Law (law@redhat.com)
* linux-proc.c (read_mapping): Scan up to end of line for filename.
Diffstat (limited to 'gdb/linux-proc.c')
-rw-r--r--gdb/linux-proc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index d6f88d3..832f14e 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -77,7 +77,14 @@ read_mapping (FILE *mapfile,
if (ret > 0 && ret != EOF && *inode != 0)
{
- ret += fscanf (mapfile, "%s\n", filename);
+ /* Eat everything up to EOL for the filename. This will prevent
+ weird filenames (such as one with embedded whitespace) from
+ confusing this code. It also makes this code more robust
+ in respect to annotations the kernel may add after the
+ filename.
+
+ Note the filename is used for informational purposes only. */
+ ret += fscanf (mapfile, "%[^\n]\n", filename);
}
else
{