summaryrefslogtreecommitdiffstats
path: root/contrib/less/edit.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-25 08:56:15 -0200
committerRenato Botelho <renato@netgate.com>2016-01-25 08:56:15 -0200
commiteb84e0723f3b4bc5e40024f66fe21c14b09e9ec4 (patch)
treefec6b99d018e13f1fccbe31478aaf29a28a55642 /contrib/less/edit.c
parentc50df8e1b90c4f9b8bbffa592477c129854776ce (diff)
parent94b1bbbd44bd88b6db1c00d795cdf7675b3ae254 (diff)
downloadFreeBSD-src-eb84e0723f3b4bc5e40024f66fe21c14b09e9ec4.zip
FreeBSD-src-eb84e0723f3b4bc5e40024f66fe21c14b09e9ec4.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'contrib/less/edit.c')
-rw-r--r--contrib/less/edit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/less/edit.c b/contrib/less/edit.c
index 5f4e679..2a35ade 100644
--- a/contrib/less/edit.c
+++ b/contrib/less/edit.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2015 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -64,7 +64,7 @@ init_textlist(tlist, str)
int meta_quoted = 0;
int delim_quoted = 0;
char *esc = get_meta_escape();
- int esclen = strlen(esc);
+ int esclen = (int) strlen(esc);
#endif
tlist->string = skipsp(str);
@@ -411,7 +411,10 @@ edit_ifile(ifile)
}
#endif
if (every_first_cmd != NULL)
+ {
+ ungetcc(CHAR_END_COMMAND);
ungetsc(every_first_cmd);
+ }
}
free(qopen_filename);
@@ -433,7 +436,8 @@ edit_ifile(ifile)
#if HILITE_SEARCH
clr_hilite();
#endif
- cmd_addhist(ml_examine, filename);
+ if (strcmp(filename, FAKE_HELPFILE) && strcmp(filename, FAKE_EMPTYFILE))
+ cmd_addhist(ml_examine, filename, 1);
if (no_display && errmsgs > 0)
{
/*
@@ -745,7 +749,8 @@ use_logfile(filename)
*/
filename = shell_unquote(filename);
exists = open(filename, OPEN_READ);
- close(exists);
+ if (exists >= 0)
+ close(exists);
exists = (exists >= 0);
/*
OpenPOWER on IntegriCloud