summaryrefslogtreecommitdiff
path: root/option.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2020-10-24 05:25:54 +0000
committerXin LI <delphij@FreeBSD.org>2020-10-24 05:25:54 +0000
commite3e1c0a5de4b6c7d51c0282b9378427383134aa9 (patch)
treed1180166250393879730fe69e09432a8195b537a /option.c
parent6aa86b45318b321ba7e9cc3c221ab9062ddac4a0 (diff)
Notes
Diffstat (limited to 'option.c')
-rw-r--r--option.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/option.c b/option.c
index d402e11752c1..9cb19bc5472d 100644
--- a/option.c
+++ b/option.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2019 Mark Nudelman
+ * Copyright (C) 1984-2020 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.
@@ -23,8 +23,9 @@
static struct loption *pendopt;
public int plusoption = FALSE;
-static char *optstring();
-static int flip_triple();
+static char *optstring LESSPARAMS((char *s, char **p_str, char *printopt,
+ char *validchars));
+static int flip_triple LESSPARAMS((int val, int lc));
extern int screen_trashed;
extern int less_is_more;
@@ -526,6 +527,24 @@ opt_prompt(o)
}
/*
+ * If the specified option can be toggled, return NULL.
+ * Otherwise return an appropriate error message.
+ */
+ public char *
+opt_toggle_disallowed(c)
+ int c;
+{
+ switch (c)
+ {
+ case 'o':
+ if (ch_getflags() & CH_CANSEEK)
+ return "Input is not a pipe";
+ break;
+ }
+ return NULL;
+}
+
+/*
* Return whether or not there is a string option pending;
* that is, if the previous option was a string-valued option letter
* (like -P) without a following string.