summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/more/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/more/main.c b/usr.bin/more/main.c
index cbe853c..a41f8e9 100644
--- a/usr.bin/more/main.c
+++ b/usr.bin/more/main.c
@@ -93,7 +93,8 @@ edit(filename)
{
register int f;
register char *m;
- off_t initial_pos, prev_pos, position();
+ off_t initial_pos, position();
+ static off_t prev_pos;
static int didpipe;
char message[MAXPATHLEN + 50], *p;
char *rindex(), *strerror(), *save(), *bad_file();
@@ -107,7 +108,7 @@ edit(filename)
filename = save(av[curr_ac]);
}
else if (strcmp(filename, "#") == 0) {
- if (*previous_file == '\0') {
+ if (!previous_file || *previous_file == '\0') {
error("no previous file");
return(0);
}
OpenPOWER on IntegriCloud