diff options
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/less.c | 11 | ||||
-rw-r--r-- | miscutils/taskset.c | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index 1a67ca7..37ec5d9 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -384,6 +384,10 @@ static void read_lines(void) linepos = 0; } /* end of "read lines until we reach cur_fline" loop */ fill_match_lines(old_max_fline); +#if ENABLE_FEATURE_LESS_REGEXP + /* prevent us from being stuck in search for a match */ + wanted_match = -1; +#endif #undef readbuf } @@ -904,13 +908,8 @@ static void goto_match(int match) match = 0; /* Try to find next match if eof isn't reached yet */ if (match >= num_matches && eof_error > 0) { - wanted_match = match; + wanted_match = match; /* "I want to read until I see N'th match" */ read_lines(); - if (wanted_match >= num_matches) { - /* We still failed to find it. Prevent future - * read_lines() from trying... */ - wanted_match = num_matches - 1; - } } if (num_matches) { normalize_match_pos(match); diff --git a/miscutils/taskset.c b/miscutils/taskset.c index 6247aa8..bf98ea1 100644 --- a/miscutils/taskset.c +++ b/miscutils/taskset.c @@ -50,6 +50,11 @@ int taskset_main(int argc ATTRIBUTE_UNUSED, char **argv) char *pid_str; char *aff = aff; /* for compiler */ + /* NB: we mimic util-linux's taskset: -p does not take + * an argument, i.e., "-pN" is NOT valid, only "-p N"! + * Indeed, util-linux-2.13-pre7 uses: + * getopt_long(argc, argv, "+pchV", ...), not "...p:..." */ + opt_complementary = "-1"; /* at least 1 arg */ opt_p = getopt32(argv, "+p"); argv += optind; |