Skip to content

Commit d450ca0

Browse files
committed
feature requests #452 #453 #458
1 parent 11a9fc4 commit d450ca0

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

Diff for: config.h.in

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373
/* Define to 1 if you have the 'pthread_setschedprio' function. */
7474
#undef HAVE_PTHREAD_SETSCHEDPRIO
7575

76+
/* Define to 1 if you have the 'pthread_set_qos_class_self_np' function. */
77+
#undef HAVE_PTHREAD_SET_QOS_CLASS_SELF_NP
78+
7679
/* Define to 1 if you have the <sched.h> header file. */
7780
#undef HAVE_SCHED_H
7881

Diff for: configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -7701,7 +7701,7 @@ save_CFLAGS=$CFLAGS
77017701
LIBS=$PTHREAD_LIBS
77027702
CFLAGS=$PTHREAD_CFLAGS
77037703

7704-
for ac_func in sched_setaffinity cpuset_setaffinity pthread_setaffinity_np pthread_setschedprio setpriority
7704+
for ac_func in pthread_set_qos_class_self_np sched_setaffinity cpuset_setaffinity pthread_setaffinity_np pthread_setschedprio setpriority
77057705
do :
77067706
as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"`
77077707
ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"

Diff for: configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ save_LIBS=$LIBS
2929
save_CFLAGS=$CFLAGS
3030
LIBS=$PTHREAD_LIBS
3131
CFLAGS=$PTHREAD_CFLAGS
32-
AC_CHECK_FUNCS([sched_setaffinity cpuset_setaffinity pthread_setaffinity_np pthread_setschedprio setpriority],[break])
32+
AC_CHECK_FUNCS([pthread_set_qos_class_self_np sched_setaffinity cpuset_setaffinity pthread_setaffinity_np pthread_setschedprio setpriority],[break])
3333
LIBS=$save_LIBS
3434
CFLAGS=$save_CFLAGS
3535

Diff for: src/ugrep.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ static void set_this_thread_affinity_and_priority(size_t cpu)
539539

540540
(void)SetThreadAffinityMask(GetCurrentThread(), DWORD_PTR(1) << cpu);
541541

542-
#elif defined(__APPLE__)
542+
#elif defined(__APPLE__) && defined(HAVE_PTHREAD_SET_QOS_CLASS_SELF_NP)
543543

544544
(void)pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0);
545545

@@ -5646,6 +5646,8 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a
56465646
;
56475647
else if (strcmp(arg, "no-confirm") == 0)
56485648
flag_confirm = false;
5649+
else if (strcmp(arg, "no-count") == 0)
5650+
flag_count = false;
56495651
else if (strcmp(arg, "no-decompress") == 0)
56505652
flag_decompress = false;
56515653
else if (strcmp(arg, "no-dereference") == 0)
@@ -5658,6 +5660,8 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a
56585660
flag_empty = false;
56595661
else if (strcmp(arg, "no-filename") == 0)
56605662
flag_no_filename = true;
5663+
else if (strcmp(arg, "no-files-with-matches") == 0)
5664+
flag_files_with_matches = false;
56615665
else if (strcmp(arg, "no-filter") == 0)
56625666
flag_filter.clear();
56635667
else if (strcmp(arg, "no-glob-ignore-case") == 0)
@@ -5717,7 +5721,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a
57175721
else if (strcmp(arg, "neg-regexp") == 0)
57185722
usage("missing argument for --", arg);
57195723
else
5720-
usage("invalid option --", arg, "--neg-regexp=, --not, --no-any-line, --no-ascii, --no-binary, --no-bool, --no-break, --no-byte-offset, --no-color, --no-config, --no-confirm, --no-decompress, --no-dereference, --no-dereference-files, --no-dotall, --no-empty, --no-filename, --no-filter, --no-glob-ignore-case, --no-group-separator, --no-heading, --no-hidden, --no-hyperlink, --no-ignore-binary, --no-ignore-case, --no-ignore-files, --no-index, --no-initial-tab, --no-invert-match, --no-line-number, --no-only-line-number, --no-only-matching, --no-messages, --no-mmap, --no-pager, --no-pretty, --no-smart-case, --no-sort, --no-split, --no-stats, --no-tree, --no-ungroup, --no-view or --null");
5724+
usage("invalid option --", arg, "--neg-regexp=, --not, --no-any-line, --no-ascii, --no-binary, --no-bool, --no-break, --no-byte-offset, --no-color, --no-config, --no-confirm, --no-count, --no-decompress, --no-dereference, --no-dereference-files, --no-dotall, --no-empty, --no-filename, --no-files-with-matches, --no-filter, --no-glob-ignore-case, --no-group-separator, --no-heading, --no-hidden, --no-hyperlink, --no-ignore-binary, --no-ignore-case, --no-ignore-files, --no-index, --no-initial-tab, --no-invert-match, --no-line-number, --no-only-line-number, --no-only-matching, --no-messages, --no-mmap, --no-pager, --no-pretty, --no-smart-case, --no-sort, --no-split, --no-stats, --no-tree, --no-ungroup, --no-view or --null");
57215725
break;
57225726

57235727
case 'o':
@@ -8321,7 +8325,11 @@ void ugrep()
83218325
}
83228326
}
83238327

8324-
// -j: case insensitive search if regex does not contain an upper case letter
8328+
// -i: disable -j (unconditional overrides conditional)
8329+
if (flag_ignore_case)
8330+
flag_smart_case = false;
8331+
8332+
// -j: smart case insensitive search if regex does not contain an upper case letter
83258333
if (flag_smart_case)
83268334
{
83278335
flag_ignore_case = true;
@@ -14849,7 +14857,7 @@ Character context on a matching line before or after a match is output when\n\
1484914857
[[:name:]] one char in POSIX class: ^ begin of line anchor\n\
1485014858
alnum a-z,A-Z,0-9 $ end of line anchor\n\
1485114859
alpha a-z,A-Z \\A begin of file anchor\n\
14852-
ascii ASCII char \\x00-\\x7f \\Z end of file anchodr\n\
14860+
ascii ASCII char \\x00-\\x7f \\Z end of file anchor\n\
1485314861
blank space or tab \\b word boundary\n\
1485414862
cntrl control characters \\B non-word boundary\n\
1485514863
digit 0-9 \\< start of word boundary\n\

0 commit comments

Comments
 (0)