summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/logf
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-08-11 21:01:51 +0200
committertv <tv@krebsco.de>2016-08-11 21:01:51 +0200
commit524601b9742ae85401805b4db61dd91c9bdf1b44 (patch)
tree2bf1d5e216e277a632cfdf9b9e307b7931ef5d1d /krebs/5pkgs/logf
parentc31c4e48b0f007709d089379edf18e41c38af68e (diff)
logf: don't call jq's gsub with empty regex :)
Diffstat (limited to 'krebs/5pkgs/logf')
-rw-r--r--krebs/5pkgs/logf/default.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/krebs/5pkgs/logf/default.nix b/krebs/5pkgs/logf/default.nix
index d9eae0a4a..ac95acb33 100644
--- a/krebs/5pkgs/logf/default.nix
+++ b/krebs/5pkgs/logf/default.nix
@@ -54,7 +54,8 @@ pkgs.writeDashBin "logf" ''
# anaphoric gsub
def agsub(re; f):
- gsub("(?<it>\(re))"; .it | f);
+ # Don't try empty regex: https://github.com/stedolan/jq/issues/1206
+ when(re != ""; gsub("(?<it>\(re))"; .it | f));
# :: [int] -> sgr
def sgr: "\u001b[\(map(tostring) | join(";"))m";