aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-05-09 06:52:21 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-05-09 06:52:21 +0000
commit40aea4772114f8c0b62595560e67b5e229b47ee6 (patch)
tree5e2286fc44947f983a5737aa576dc20a0009f51c /gdb/source.c
parent9f0682fe89d9bb1107239411dc555d4063543ce0 (diff)
downloadgdb-40aea4772114f8c0b62595560e67b5e229b47ee6.zip
gdb-40aea4772114f8c0b62595560e67b5e229b47ee6.tar.gz
gdb-40aea4772114f8c0b62595560e67b5e229b47ee6.tar.bz2
source.c: Use fgetc instead of getc.
On AIX, getc is a macro which triggers an -Wunused-value warning. gdb/ChangeLog: * source.c (forward_search_command): Replace call to getc by call to fgetc. (reverse_search_command): Likewise.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/source.c b/gdb/source.c
index d816c9e..710b90c 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1613,7 +1613,7 @@ forward_search_command (char *regex, int from_tty)
buf = xmalloc (cursize);
p = buf;
- c = getc (stream);
+ c = fgetc (stream);
if (c == EOF)
break;
do
@@ -1627,7 +1627,7 @@ forward_search_command (char *regex, int from_tty)
cursize = newsize;
}
}
- while (c != '\n' && (c = getc (stream)) >= 0);
+ while (c != '\n' && (c = fgetc (stream)) >= 0);
/* Remove the \r, if any, at the end of the line, otherwise
regular expressions that end with $ or \n won't work. */
@@ -1698,14 +1698,14 @@ reverse_search_command (char *regex, int from_tty)
char buf[4096]; /* Should be reasonable??? */
char *p = buf;
- c = getc (stream);
+ c = fgetc (stream);
if (c == EOF)
break;
do
{
*p++ = c;
}
- while (c != '\n' && (c = getc (stream)) >= 0);
+ while (c != '\n' && (c = fgetc (stream)) >= 0);
/* Remove the \r, if any, at the end of the line, otherwise
regular expressions that end with $ or \n won't work. */