summaryrefslogtreecommitdiff
path: root/gdb/cli/cli-script.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-01-24 20:56:33 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-01-24 20:56:33 +0000
commit5eb09c030ab6d18adeea75261b148ed325c51cc0 (patch)
treec742ae7636af4d7fa005ad2795bc7cdaeaf6f833 /gdb/cli/cli-script.c
parentee3529349cce157cbef4833203fd0912a89e9d73 (diff)
downloadgdb-5eb09c030ab6d18adeea75261b148ed325c51cc0.tar.gz
gdb/
Code cleanup. * cli/cli-cmds.c (source_script_from_stream): Never fclose STREAM. Update the function comment for it. (source_script_with_search): Call make_cleanup_fclose for STREAM. * cli/cli-script.c (script_from_file): Do not call make_cleanup_fclose for STREAM.
Diffstat (limited to 'gdb/cli/cli-script.c')
-rw-r--r--gdb/cli/cli-script.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index c8da8c83e14..cfa1c771c50 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -1614,11 +1614,9 @@ script_from_file (FILE *stream, const char *file)
if (stream == NULL)
internal_error (__FILE__, __LINE__, _("called with NULL file pointer!"));
- old_cleanups = make_cleanup_fclose (stream);
-
old_lines.old_line = source_line_number;
old_lines.old_file = source_file_name;
- make_cleanup (source_cleanup_lines, &old_lines);
+ old_cleanups = make_cleanup (source_cleanup_lines, &old_lines);
source_line_number = 0;
source_file_name = file;
/* This will get set every time we read a line. So it won't stay ""