Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146156741
D35836.id108239.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35836.id108239.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D35836: sh: accept fc options grouped behind one '-'
Attached
Detach File
Event Timeline
Log In to Comment