[PATCH] Small regresson when series file is empty.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
guilt | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/guilt b/guilt
index f77c050..58df606 100755
--- a/guilt
+++ b/guilt
@@ -246,8 +246,9 @@ head_check()
# usage: series_insert_patch <patchname>
series_insert_patch()
{
- awk -v top="`get_top`" -v new="$1" '{
- if (top == "" && NR == 1) print new;
+ awk -v top="`get_top`" -v new="$1" \
+ 'BEGIN{if (top == "") print new;}
+ {
print $0;
if (top != "" && top == $0) print new;
}' "$series" > "$series.tmp"
--
1.5.2.1