Page MenuHomeFreeBSD

D35836.id108239.diff
No OneTemporary

D35836.id108239.diff

Index: bin/sh/histedit.c
===================================================================
--- bin/sh/histedit.c
+++ bin/sh/histedit.c
@@ -77,7 +77,7 @@
static bool in_command_completion;
static char *fc_replace(const char *, char *, char *);
-static int not_fcnumber(const char *);
+static int fcnumber(const char *);
static int str_to_event(const char *, int);
static int comparator(const void *, const void *, void *);
static char **sh_matches(const char *, int, int);
@@ -278,7 +278,7 @@
if (argc == 1)
error("missing history argument");
- while (not_fcnumber(*argptr) && (ch = nextopt("e:lnrs")) != '\0')
+ while ((ch = nextopt("e:lnrs")) != '\0') {
switch ((char)ch) {
case 'e':
editor = shoptarg;
@@ -296,6 +296,9 @@
sflg = 1;
break;
}
+ if (fcnumber(*nextopt_optptr != 0 ? nextopt_optptr : *argptr))
+ break;
+ }
savehandler = handler;
/*
@@ -485,13 +488,13 @@
}
static int
-not_fcnumber(const char *s)
+fcnumber(const char *s)
{
if (s == NULL)
- return (0);
+ return (1);
if (*s == '-')
s++;
- return (!is_number(s));
+ return (is_number(s));
}
static int

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 1, 7:37 AM (16 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29096684
Default Alt Text
D35836.id108239.diff (1 KB)

Event Timeline