From: Pierre Habouzit Date: Thu, 14 Jun 2007 13:20:23 GMT Subject: [PATCH] Small regresson when series file is empty. Message-ID: <11818272231872-git-send-email-madcoder@debian.org> In-Reply-To: <11818254621527-git-send-email-madcoder@debian.org> Signed-off-by: Pierre Habouzit --- 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 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