aboutsummaryrefslogtreecommitdiff
path: root/ctct.in
diff options
context:
space:
mode:
Diffstat (limited to 'ctct.in')
-rw-r--r--ctct.in12
1 files changed, 6 insertions, 6 deletions
diff --git a/ctct.in b/ctct.in
index 624566c..c40c15e 100644
--- a/ctct.in
+++ b/ctct.in
@@ -2,7 +2,7 @@
#
# ctct - a simple console contact manager
#
-# Copyright 2015 - 2017 Einhard Leichtfuß
+# Copyright 2015 - 2018 Einhard Leichtfuß
#
# ctct is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
@@ -59,7 +59,7 @@ EOF
function cleanup()
{
- test -v tmp_file && test -f "$tmp_file" && rm "$tmp_file"
+ test -v tmp_file && test -f "$tmp_file" && rm -f "$tmp_file"
}
trap cleanup EXIT
@@ -186,7 +186,7 @@ function search_file()
for file in "$datadir"/*
do
- # NEW
+ # Ignore non-regular files.
test -f "$file" || continue
valid=true
@@ -194,13 +194,13 @@ function search_file()
then
for pattern in "$@"
do
- ! grep -qi "$pattern" "$file" && valid=false && break
+ ! grep -qEi "$pattern" "$file" && valid=false && break
done
else
for pattern in "$@"
do
! eval "$output_program" < "$file" | \
- grep -qi "$pattern" "$file" && valid=false && break
+ grep -qEi "$pattern" "$file" && valid=false && break
done
fi
if $valid
@@ -255,7 +255,7 @@ function edit_file()
! $new && eval "$output_program" < "$file" > "$tmp_file"
"$editor" "$tmp_file"
eval "$input_program" < "$tmp_file" > "$file"
- rm "$tmp_file" && unset tmp_file
+ rm -f "$tmp_file" && unset tmp_file
fi
}