From d2db60569c8f9f2d3439edc9eee4f9330a317023 Mon Sep 17 00:00:00 2001 From: sabetts Date: Tue, 5 Oct 2004 23:29:39 +0000 Subject: * src/actions.c (cmd_source): display an error message if no file is supplied. --- ChangeLog | 1 + src/actions.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 349c961..bb2bbe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * src/actions.c (cmd_unsetenv): add an '=' to the string passed to putenv. + (cmd_source): display an error message if no file is supplied. * src/main.c (print_version): update copyright date. diff --git a/src/actions.c b/src/actions.c index 9c97332..143f965 100644 --- a/src/actions.c +++ b/src/actions.c @@ -797,6 +797,12 @@ cmd_source (int interactive, char *data) { FILE *fileptr; + if (data == NULL) + { + message (" source: one argument required "); + return NULL; + } + if ((fileptr = fopen (data, "r")) == NULL) marked_message_printf (0, 0, " source: %s : %s ", data, strerror(errno)); else -- cgit v1.2.3