Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Ismael Luceno (fb3f9d42fb49719d21a436b01d6b7990ecbd4698)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Ismael Luceno (fb3f9d42fb49719d21a436b01d6b7990ecbd4698)
  • Date: Sat, 18 Feb 2017 20:53:32 +0000

GIT changes to master sorcery by Ismael Luceno <ismael AT sourcemage.org>:

usr/sbin/gaze | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit fb3f9d42fb49719d21a436b01d6b7990ecbd4698
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

gaze from: Re-implement escape function to work in GAWK

GAWK regexp conversion from string seems broken for "\\".

diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index fa46b00..c8601c8 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -677,15 +677,26 @@ function show_from() {
xargs awk -v str="$string" -v verbose="$GAZE_VERBOSE" -v isregex="$mode" \
-v
xclude="^(${LOG_DIRECTORY#$STATE_ROOT}|${STATE_DIRECTORY#$STATE_ROOT})" \
' BEGIN {
- E["\["];E["\]"];E["\("];E["\)"];E["\{"];E["\}"]
-
E["\."];E["\\"];E["\*"];E["\+"];E["\?"];E["\|"];E["\^"];E["\$"]
verbose = (verbose != "false")
isregex = (isregex == "regex")
whole = isregex ? (str ~ /^\^/ && str ~ /\$$/) : (str ~ /^\//)
if (!isregex) str = (whole ? "^" : "/") escape(str) "$"
}
function escape(s) {
- for (i in E) gsub(i, i, s)
+ gsub(/\\/, "\\\\", s)
+ gsub(/\[/, "\\[", s)
+ gsub(/\]/, "\\]", s)
+ gsub(/\(/, "\\(", s)
+ gsub(/\)/, "\\)", s)
+ gsub(/\{/, "\\{", s)
+ gsub(/\}/, "\\}", s)
+ gsub(/\./, "\\.", s)
+ gsub(/\*/, "\\*", s)
+ gsub(/\+/, "\\+", s)
+ gsub(/\?/, "\\?", s)
+ gsub(/\|/, "\\|", s)
+ gsub(/\^/, "\\^", s)
+ gsub(/\$/, "\\$", s)
return s
}
$0 ~ str && $0 !~ xclude {



  • [SM-Commit] GIT changes to master sorcery by Ismael Luceno (fb3f9d42fb49719d21a436b01d6b7990ecbd4698), Ismael Luceno, 02/18/2017

Archive powered by MHonArc 2.6.24.

Top of Page