summaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2009-07-23 23:20:00 +0000
committerKeith Seitz <keiths@redhat.com>2009-07-23 23:20:00 +0000
commitc41af7c5c8de6e1372c6b7abe55cd800d159055e (patch)
tree7eddbb548f9b9e8094926a3346ad6e380aacc728 /gdb/source.c
parentd3ca52e67a07631760df51174521af28c20ded5e (diff)
downloadgdb-c41af7c5c8de6e1372c6b7abe55cd800d159055e.tar.gz
* source.c (forward_search_command): Don't fclose the stream,
just run the cleanups. (reverse_search_command): Likewise.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/source.c b/gdb/source.c
index c40a5aadc0c..c39c0a6adfb 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1612,7 +1612,7 @@ forward_search_command (char *regex, int from_tty)
if (re_exec (buf) > 0)
{
/* Match! */
- fclose (stream);
+ do_cleanups (cleanups);
print_source_lines (current_source_symtab, line, line + 1, 0);
set_internalvar_integer (lookup_internalvar ("_"), line);
current_source_line = max (line - lines_to_list / 2, 1);
@@ -1690,7 +1690,7 @@ reverse_search_command (char *regex, int from_tty)
if (re_exec (buf) > 0)
{
/* Match! */
- fclose (stream);
+ do_cleanups (cleanups);
print_source_lines (current_source_symtab, line, line + 1, 0);
set_internalvar_integer (lookup_internalvar ("_"), line);
current_source_line = max (line - lines_to_list / 2, 1);
@@ -1699,7 +1699,7 @@ reverse_search_command (char *regex, int from_tty)
line--;
if (fseek (stream, current_source_symtab->line_charpos[line - 1], 0) < 0)
{
- fclose (stream);
+ do_cleanups (cleanups);
perror_with_name (current_source_symtab->filename);
}
}