Skip to content

Commit

Permalink
released 3.9.3
Browse files Browse the repository at this point in the history
fix #241
  • Loading branch information
genivia-inc committed Dec 29, 2022
1 parent 7032442 commit e006406
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5237,7 +5237,7 @@ in markdown:



ugrep 3.9.0 August 12, 2022 UGREP(1)
ugrep 3.9.3 December 29, 2022 UGREP(1)

🔝 [Back to table of contents](#toc)

Expand Down
Binary file modified bin/win32/ugrep.exe
Binary file not shown.
Binary file modified bin/win64/ugrep.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions include/reflex/pcre2matcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ class PCRE2Matcher : public PatternMatcher<std::string> {
int err;
PCRE2_SIZE pos;
ASSERT(pat_ != NULL);
if (cop_ & PCRE2_UTF)
cop_ |= PCRE2_MATCH_INVALID_UTF; // recommended in the PCRE2 docs when using UTF-8
opc_ = pcre2_compile(reinterpret_cast<PCRE2_SPTR>(pat_->c_str()), static_cast<PCRE2_SIZE>(pat_->size()), cop_, &err, &pos, NULL);
if (opc_ == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion man/ugrep.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH UGREP "1" "August 12, 2022" "ugrep 3.9.0" "User Commands"
.TH UGREP "1" "December 29, 2022" "ugrep 3.9.3" "User Commands"
.SH NAME
\fBugrep\fR, \fBug\fR -- file pattern searcher
.SH SYNOPSIS
Expand Down
4 changes: 3 additions & 1 deletion src/glob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ static bool match(const char *text, const char *glob)
text1_backup = NULL;
glob1_backup = NULL;
text2_backup = text;
glob2_backup = ++glob;
glob2_backup = glob;
if (*text != '/')
glob++;
continue;
}

Expand Down
16 changes: 13 additions & 3 deletions src/ugrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4404,7 +4404,9 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a
flag_cpp = true;
else if (strcmp(arg, "csv") == 0)
flag_csv = true;
else if (strcmp(arg, "colors") == 0 || strcmp(arg, "colours") == 0)
else if (strcmp(arg, "colors") == 0 ||
strcmp(arg, "colours") == 0 ||
strcmp(arg, "context") == 0)
usage("missing argument for --", arg);
else
usage("invalid option --", arg, "--color, --colors, --column-number, --config, --confirm, --context, --count, --cpp or --csv");
Expand All @@ -4425,7 +4427,9 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a
flag_directories = arg + 12;
else if (strcmp(arg, "dotall") == 0)
flag_dotall = true;
else if (strcmp(arg, "depth") == 0)
else if (strcmp(arg, "depth") == 0 ||
strcmp(arg, "devices") == 0 ||
strcmp(arg, "directories") == 0)
usage("missing argument for --", arg);
else
usage("invalid option --", arg, "--decompress, --depth, --dereference, --dereference-recursive, --devices, --directories or --dotall");
Expand Down Expand Up @@ -4624,7 +4628,13 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a
flag_max_mmap = strtopos(arg + 5, "invalid argument --mmap=");
else if (strcmp(arg, "messages") == 0)
flag_no_messages = false;
else if (strcmp(arg, "max-count") == 0 || strcmp(arg, "max-depth") == 0 || strcmp(arg, "max-files") == 0 || strcmp(arg, "max-line") == 0 || strcmp(arg, "min-count") == 0 || strcmp(arg, "min-depth") == 0 || strcmp(arg, "min-line") == 0)
else if (strcmp(arg, "max-count") == 0 ||
strcmp(arg, "max-depth") == 0 ||
strcmp(arg, "max-files") == 0 ||
strcmp(arg, "max-line") == 0 ||
strcmp(arg, "min-count") == 0 ||
strcmp(arg, "min-depth") == 0 ||
strcmp(arg, "min-line") == 0)
usage("missing argument for --", arg);
else
usage("invalid option --", arg, "--match, --max-count, --max-depth, --max-files, --max-line, --min-count, --min-depth, --min-line, --mmap or --messages");
Expand Down
2 changes: 1 addition & 1 deletion src/ugrep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define UGREP_HPP

// ugrep version
#define UGREP_VERSION "3.9.2"
#define UGREP_VERSION "3.9.3"

// disable mmap because mmap is almost always slower than the file reading speed improvements since 3.0.0
#define WITH_NO_MMAP
Expand Down

0 comments on commit e006406

Please sign in to comment.