Hello community,
here is the log from the commit of package the_silver_searcher for
openSUSE:Factory checked in at 2017-05-27 13:17:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/the_silver_searcher (Old)
and /work/SRC/openSUSE:Factory/.the_silver_searcher.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "the_silver_searcher"
Sat May 27 13:17:48 2017 rev:10 rq:498006 version:1.0.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/the_silver_searcher/the_silver_searcher.changes
2017-01-22 00:21:58.208032218 +0100
+++
/work/SRC/openSUSE:Factory/.the_silver_searcher.new/the_silver_searcher.changes
2017-05-27 13:18:51.499320675 +0200
@@ -1,0 +2,7 @@
+Wed May 24 14:27:46 UTC 2017 - [email protected]
+
+- update to 1.0.3:
+ * add log, elm, twig file types
+ * *.js now ignores *.min.js, add .es6 to js file type
+
+-------------------------------------------------------------------
Old:
----
the_silver_searcher-1.0.2.tar.gz
the_silver_searcher-1.0.2.tar.gz.asc
New:
----
the_silver_searcher-1.0.3.tar.gz
the_silver_searcher-1.0.3.tar.gz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ the_silver_searcher.spec ++++++
--- /var/tmp/diff_new_pack.zLWBXK/_old 2017-05-27 13:18:52.595165751 +0200
+++ /var/tmp/diff_new_pack.zLWBXK/_new 2017-05-27 13:18:52.595165751 +0200
@@ -1,7 +1,7 @@
#
# spec file for package the_silver_searcher
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: the_silver_searcher
-Version: 1.0.2
+Version: 1.0.3
Release: 0
Summary: A code-searching tool similar to ack, but faster
License: Apache-2.0
@@ -51,7 +51,7 @@
make %{?_smp_mflags}
%install
-make %{?_smp_mflags} DESTDIR=%{buildroot} install
+%make_install
mkdir -p %{buildroot}/%{_sysconfdir}/bash_completion.d
mv -v %{buildroot}%{_datadir}/%{name}/completions/ag.bashcomp.sh
%{buildroot}/%{_sysconfdir}/bash_completion.d/%{name}
++++++ the_silver_searcher-1.0.2.tar.gz -> the_silver_searcher-1.0.3.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/README.md
new/the_silver_searcher-1.0.3/README.md
--- old/the_silver_searcher-1.0.2/README.md 2016-12-03 22:34:14.000000000
+0100
+++ new/the_silver_searcher-1.0.3/README.md 2017-01-12 18:55:41.000000000
+0100
@@ -76,6 +76,12 @@
sbopkg -i the_silver_searcher
+* openSUSE:
+
+ zypper install the_silver_searcher
+
+* SUSE Linux Enterprise: Follow [these simple
instructions](https://software.opensuse.org/download.html?project=utilities&package=the_silver_searcher).
+
### BSD
@@ -111,6 +117,10 @@
yum -y groupinstall "Development Tools"
yum -y install pcre-devel xz-devel
+ * openSUSE:
+
+ zypper source-install --build-deps-only the_silver_searcher
+
* Windows: It's complicated. See [this wiki
page](https://github.com/ggreer/the_silver_searcher/wiki/Windows).
2. Run the build script (which just runs aclocal, automake, etc):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/aclocal.m4
new/the_silver_searcher-1.0.3/aclocal.m4
--- old/the_silver_searcher-1.0.2/aclocal.m4 2016-12-03 23:41:18.000000000
+0100
+++ new/the_silver_searcher-1.0.3/aclocal.m4 2017-05-03 08:34:47.000000000
+0200
@@ -1187,9 +1187,9 @@
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-dnl serial 11 (pkg-config-0.29.1)
-dnl
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
dnl Copyright © 2004 Scott James Remnant <[email protected]>.
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
dnl
@@ -1230,7 +1230,7 @@
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
-[m4_define([PKG_MACROS_VERSION], [0.29.1])
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but
]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@@ -1331,7 +1331,7 @@
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -1341,11 +1341,11 @@
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors
--cflags --libs "$2" 2>&1`
- else
+ else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs
"$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@@ -1362,7 +1362,7 @@
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/configure
new/the_silver_searcher-1.0.3/configure
--- old/the_silver_searcher-1.0.2/configure 2016-12-03 23:41:19.000000000
+0100
+++ new/the_silver_searcher-1.0.3/configure 2017-05-03 08:34:48.000000000
+0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for the_silver_searcher 1.0.2.
+# Generated by GNU Autoconf 2.69 for the_silver_searcher 1.0.3.
#
# Report bugs to <https://github.com/ggreer/the_silver_searcher/issues>.
#
@@ -581,8 +581,8 @@
# Identity of this package.
PACKAGE_NAME='the_silver_searcher'
PACKAGE_TARNAME='the_silver_searcher'
-PACKAGE_VERSION='1.0.2'
-PACKAGE_STRING='the_silver_searcher 1.0.2'
+PACKAGE_VERSION='1.0.3'
+PACKAGE_STRING='the_silver_searcher 1.0.3'
PACKAGE_BUGREPORT='https://github.com/ggreer/the_silver_searcher/issues'
PACKAGE_URL='https://github.com/ggreer/the_silver_searcher'
@@ -1297,7 +1297,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures the_silver_searcher 1.0.2 to adapt to many kinds of
systems.
+\`configure' configures the_silver_searcher 1.0.3 to adapt to many kinds of
systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1368,7 +1368,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of the_silver_searcher 1.0.2:";;
+ short | recursive ) echo "Configuration of the_silver_searcher 1.0.3:";;
esac
cat <<\_ACEOF
@@ -1471,7 +1471,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-the_silver_searcher configure 1.0.2
+the_silver_searcher configure 1.0.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1943,7 +1943,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by the_silver_searcher $as_me 1.0.2, which was
+It was created by the_silver_searcher $as_me 1.0.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2807,7 +2807,7 @@
# Define the identity of the package.
PACKAGE='the_silver_searcher'
- VERSION='1.0.2'
+ VERSION='1.0.3'
# Some tools Automake needs.
@@ -4096,8 +4096,8 @@
fi
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCRE" >&5
-$as_echo_n "checking for PCRE... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpcre" >&5
+$as_echo_n "checking for libpcre... " >&6; }
if test -n "$PCRE_CFLAGS"; then
pkg_cv_PCRE_CFLAGS="$PCRE_CFLAGS"
@@ -4137,7 +4137,7 @@
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -4164,7 +4164,7 @@
and PCRE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -5367,8 +5367,8 @@
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LZMA" >&5
-$as_echo_n "checking for LZMA... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblzma" >&5
+$as_echo_n "checking for liblzma... " >&6; }
if test -n "$LZMA_CFLAGS"; then
pkg_cv_LZMA_CFLAGS="$LZMA_CFLAGS"
@@ -5408,7 +5408,7 @@
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -5435,7 +5435,7 @@
and LZMA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -6107,7 +6107,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by the_silver_searcher $as_me 1.0.2, which was
+This file was extended by the_silver_searcher $as_me 1.0.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6174,7 +6174,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-the_silver_searcher config.status 1.0.2
+the_silver_searcher config.status 1.0.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/configure.ac
new/the_silver_searcher-1.0.3/configure.ac
--- old/the_silver_searcher-1.0.2/configure.ac 2016-12-03 23:40:54.000000000
+0100
+++ new/the_silver_searcher-1.0.3/configure.ac 2017-05-03 08:34:34.000000000
+0200
@@ -1,6 +1,6 @@
AC_INIT(
[the_silver_searcher],
- [1.0.2],
+ [1.0.3],
[https://github.com/ggreer/the_silver_searcher/issues],
[the_silver_searcher],
[https://github.com/ggreer/the_silver_searcher])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/src/ignore.c
new/the_silver_searcher-1.0.3/src/ignore.c
--- old/the_silver_searcher-1.0.2/src/ignore.c 2016-12-03 21:46:47.000000000
+0100
+++ new/the_silver_searcher-1.0.3/src/ignore.c 2017-01-24 06:47:50.000000000
+0100
@@ -117,10 +117,11 @@
char ***patterns_p;
size_t *patterns_len;
if (is_fnmatch(pattern)) {
- if (pattern[0] == '*' && pattern[1] == '.' && !(is_fnmatch(pattern +
2))) {
+ if (pattern[0] == '*' && pattern[1] == '.' && strchr(pattern + 2, '.')
&& !is_fnmatch(pattern + 2)) {
patterns_p = &(ig->extensions);
patterns_len = &(ig->extensions_len);
pattern += 2;
+ pattern_len -= 2;
} else if (pattern[0] == '/') {
patterns_p = &(ig->slash_regexes);
patterns_len = &(ig->slash_regexes_len);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/src/lang.c
new/the_silver_searcher-1.0.3/src/lang.c
--- old/the_silver_searcher-1.0.2/src/lang.c 2016-11-28 06:07:11.000000000
+0100
+++ new/the_silver_searcher-1.0.3/src/lang.c 2017-05-03 08:21:18.000000000
+0200
@@ -25,6 +25,7 @@
{ "ebuild", { "ebuild", "eclass" } },
{ "elisp", { "el" } },
{ "elixir", { "ex", "eex", "exs" } },
+ { "elm", { "elm" } },
{ "erlang", { "erl", "hrl" } },
{ "factor", { "factor" } },
{ "fortran", { "f", "f77", "f90", "f95", "f03", "for", "ftn", "fpp" } },
@@ -32,7 +33,7 @@
{ "gettext", { "po", "pot", "mo" } },
{ "glsl", { "vert", "tesc", "tese", "geom", "frag", "comp" } },
{ "go", { "go" } },
- { "groovy", { "groovy", "gtmpl", "gpp", "grunit" } },
+ { "groovy", { "groovy", "gtmpl", "gpp", "grunit", "gradle" } },
{ "haml", { "haml" } },
{ "haskell", { "hs", "lhs" } },
{ "hh", { "h" } },
@@ -40,7 +41,7 @@
{ "ini", { "ini" } },
{ "jade", { "jade" } },
{ "java", { "java", "properties" } },
- { "js", { "js", "jsx", "vue" } },
+ { "js", { "es6", "js", "jsx", "vue" } },
{ "json", { "json" } },
{ "jsp", { "jsp", "jspx", "jhtm", "jhtml" } },
{ "julia", { "jl" } },
@@ -48,6 +49,7 @@
{ "less", { "less" } },
{ "liquid", { "liquid" } },
{ "lisp", { "lisp", "lsp" } },
+ { "log", { "log" } },
{ "lua", { "lua" } },
{ "m4", { "m4" } },
{ "make", { "Makefiles", "mk", "mak" } },
@@ -94,6 +96,7 @@
{ "tt", { "tt", "tt2", "ttml" } },
{ "toml", { "toml" } },
{ "ts", { "ts", "tsx" } },
+ { "twig", { "twig" } },
{ "vala", { "vala", "vapi" } },
{ "vb", { "bas", "cls", "frm", "ctl", "vb", "resx" } },
{ "velocity", { "vm", "vtl", "vsl" } },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/src/options.c
new/the_silver_searcher-1.0.3/src/options.c
--- old/the_silver_searcher-1.0.2/src/options.c 2016-12-03 22:54:24.000000000
+0100
+++ new/the_silver_searcher-1.0.3/src/options.c 2017-05-03 08:21:18.000000000
+0200
@@ -57,7 +57,8 @@
(Enabled by default)\n\
-C --context [LINES] Print lines before and after matches (Default: 2)\n\
--[no]group Same as --[no]break --[no]heading\n\
- -g PATTERN Print filenames matching PATTERN\n\
+ -g --filename-pattern PATTERN\n\
+ Print filenames matching PATTERN\n\
-l --files-with-matches Only print filenames that contain matches\n\
(don't print the matching lines)\n\
-L --files-without-matches\n\
@@ -246,6 +247,7 @@
{ "debug", no_argument, NULL, 'D' },
{ "depth", required_argument, NULL, 0 },
{ "filename", no_argument, NULL, 0 },
+ { "filename-pattern", required_argument, NULL, 'g' },
{ "file-search-regex", required_argument, NULL, 'G' },
{ "files-with-matches", no_argument, NULL, 'l' },
{ "files-without-matches", no_argument, NULL, 'L' },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/src/search.c
new/the_silver_searcher-1.0.3/src/search.c
--- old/the_silver_searcher-1.0.2/src/search.c 2016-12-03 23:40:19.000000000
+0100
+++ new/the_silver_searcher-1.0.3/src/search.c 2017-05-03 08:34:17.000000000
+0200
@@ -45,18 +45,18 @@
matches_len = 1;
} else if (opts.literal) {
const char *match_ptr = buf;
- strncmp_fp ag_strnstr_fp = get_strstr(opts.casing);
while (buf_offset < buf_len) {
/* hash_strnstr only for little-endian platforms that allow unaligned access */
#if defined(__i386__) || defined(__x86_64__)
/* Decide whether to fall back on boyer-moore */
- if ((size_t)opts.query_len < 2 * sizeof(uint16_t) - 1 ||
opts.query_len >= UCHAR_MAX)
- match_ptr = ag_strnstr_fp(match_ptr, opts.query, buf_len -
buf_offset, opts.query_len, alpha_skip_lookup, find_skip_lookup);
- else
+ if ((size_t)opts.query_len < 2 * sizeof(uint16_t) - 1 ||
opts.query_len >= UCHAR_MAX) {
+ match_ptr = boyer_moore_strnstr(match_ptr, opts.query, buf_len
- buf_offset, opts.query_len, alpha_skip_lookup, find_skip_lookup, opts.casing
== CASE_INSENSITIVE);
+ } else {
match_ptr = hash_strnstr(match_ptr, opts.query, buf_len -
buf_offset, opts.query_len, h_table, opts.casing == CASE_SENSITIVE);
+ }
#else
- match_ptr = ag_strnstr_fp(match_ptr, opts.query, buf_len -
buf_offset, opts.query_len, alpha_skip_lookup, find_skip_lookup);
+ match_ptr = boyer_moore_strnstr(match_ptr, opts.query, buf_len -
buf_offset, opts.query_len, alpha_skip_lookup, find_skip_lookup, opts.casing ==
CASE_INSENSITIVE);
#endif
if (match_ptr == NULL) {
@@ -239,13 +239,30 @@
}
void search_file(const char *file_full_path) {
- int fd;
+ int fd = -1;
off_t f_len = 0;
char *buf = NULL;
struct stat statbuf;
int rv = 0;
FILE *fp = NULL;
+ rv = stat(file_full_path, &statbuf);
+ if (rv != 0) {
+ log_err("Skipping %s: Error fstat()ing file.", file_full_path);
+ goto cleanup;
+ }
+
+ if (opts.stdout_inode != 0 && opts.stdout_inode == statbuf.st_ino) {
+ log_debug("Skipping %s: stdout is redirected to it", file_full_path);
+ goto cleanup;
+ }
+
+ // handling only regular files and FIFOs
+ if (!S_ISREG(statbuf.st_mode) && !S_ISFIFO(statbuf.st_mode)) {
+ log_err("Skipping %s: Mode %u is not a file.", file_full_path,
statbuf.st_mode);
+ goto cleanup;
+ }
+
fd = open(file_full_path, O_RDONLY);
if (fd < 0) {
/* XXXX: strerror is not thread-safe */
@@ -253,6 +270,7 @@
goto cleanup;
}
+ // repeating stat check with file handle to prevent TOCTOU issue
rv = fstat(fd, &statbuf);
if (rv != 0) {
log_err("Skipping %s: Error fstat()ing file.", file_full_path);
@@ -264,7 +282,8 @@
goto cleanup;
}
- if ((statbuf.st_mode & S_IFMT) == 0) {
+ // handling only regular files and FIFOs
+ if (!S_ISREG(statbuf.st_mode) && !S_ISFIFO(statbuf.st_mode)) {
log_err("Skipping %s: Mode %u is not a file.", file_full_path,
statbuf.st_mode);
goto cleanup;
}
@@ -360,7 +379,9 @@
UnmapViewOfFile(buf);
#else
if (opts.mmap) {
- munmap(buf, f_len);
+ if (buf != MAP_FAILED) {
+ munmap(buf, f_len);
+ }
} else {
free(buf);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/src/util.c
new/the_silver_searcher-1.0.3/src/util.c
--- old/the_silver_searcher-1.0.2/src/util.c 2016-12-03 21:46:47.000000000
+0100
+++ new/the_silver_searcher-1.0.3/src/util.c 2017-05-03 08:29:10.000000000
+0200
@@ -176,30 +176,12 @@
/* Boyer-Moore strstr */
const char *boyer_moore_strnstr(const char *s, const char *find, const size_t
s_len, const size_t f_len,
- const size_t alpha_skip_lookup[], const size_t
*find_skip_lookup) {
+ const size_t alpha_skip_lookup[], const size_t
*find_skip_lookup, const int case_insensitive) {
ssize_t i;
size_t pos = f_len - 1;
while (pos < s_len) {
- for (i = f_len - 1; i >= 0 && s[pos] == find[i]; pos--, i--) {
- }
- if (i < 0) {
- return s + pos + 1;
- }
- pos += ag_max(alpha_skip_lookup[(unsigned char)s[pos]],
find_skip_lookup[i]);
- }
-
- return NULL;
-}
-
-/* Copy-pasted from above. Yes I know this is bad. One day I might even fix
it. */
-const char *boyer_moore_strncasestr(const char *s, const char *find, const
size_t s_len, const size_t f_len,
- const size_t alpha_skip_lookup[], const
size_t *find_skip_lookup) {
- ssize_t i;
- size_t pos = f_len - 1;
-
- while (pos < s_len) {
- for (i = f_len - 1; i >= 0 && tolower(s[pos]) == find[i]; pos--, i--) {
+ for (i = f_len - 1; i >= 0 && (case_insensitive ? tolower(s[pos]) :
s[pos]) == find[i]; pos--, i--) {
}
if (i < 0) {
return s + pos + 1;
@@ -246,17 +228,6 @@
return NULL;
}
-
-strncmp_fp get_strstr(enum case_behavior casing) {
- strncmp_fp ag_strncmp_fp = &boyer_moore_strnstr;
-
- if (casing == CASE_INSENSITIVE) {
- ag_strncmp_fp = &boyer_moore_strncasestr;
- }
-
- return ag_strncmp_fp;
-}
-
size_t invert_matches(const char *buf, const size_t buf_len, match_t
matches[], size_t matches_len) {
size_t i;
size_t match_read_index = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/src/util.h
new/the_silver_searcher-1.0.3/src/util.h
--- old/the_silver_searcher-1.0.2/src/util.h 2016-12-03 21:46:47.000000000
+0100
+++ new/the_silver_searcher-1.0.3/src/util.h 2017-05-03 08:29:10.000000000
+0200
@@ -47,8 +47,6 @@
ag_stats stats;
-typedef const char *(*strncmp_fp)(const char *, const char *, const size_t,
const size_t, const size_t[], const size_t *);
-
/* Union to translate between chars and words without violating strict
aliasing */
typedef union {
char as_chars[sizeof(uint16_t)];
@@ -67,13 +65,9 @@
size_t ag_max(size_t a, size_t b);
const char *boyer_moore_strnstr(const char *s, const char *find, const size_t
s_len, const size_t f_len,
- const size_t alpha_skip_lookup[], const size_t
*find_skip_lookup);
-const char *boyer_moore_strncasestr(const char *s, const char *find, const
size_t s_len, const size_t f_len,
- const size_t alpha_skip_lookup[], const
size_t *find_skip_lookup);
+ const size_t alpha_skip_lookup[], const size_t
*find_skip_lookup, const int case_insensitive);
const char *hash_strnstr(const char *s, const char *find, const size_t s_len,
const size_t f_len, uint8_t *h_table, const int case_sensitive);
-strncmp_fp get_strstr(enum case_behavior opts);
-
size_t invert_matches(const char *buf, const size_t buf_len, match_t
matches[], size_t matches_len);
void realloc_matches(match_t **matches, size_t *matches_size, size_t
matches_len);
void compile_study(pcre **re, pcre_extra **re_extra, char *q, const int
pcre_opts, const int study_opts);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/the_silver_searcher-1.0.2/the_silver_searcher.spec
new/the_silver_searcher-1.0.3/the_silver_searcher.spec
--- old/the_silver_searcher-1.0.2/the_silver_searcher.spec 2016-12-03
23:42:31.000000000 +0100
+++ new/the_silver_searcher-1.0.3/the_silver_searcher.spec 2017-05-03
08:34:57.000000000 +0200
@@ -2,7 +2,7 @@
Name: the_silver_searcher
-Version: 1.0.2
+Version: 1.0.3
Release: 1%{?dist}
Summary: A code-searching tool similar to ack, but faster