Subject: [PATCH] Small regresson when series file is empty.

From: Pierre Habouzit <[email-masked]>
Date: Thu, 14 Jun 2007 15:20:23 +0200

Signed-off-by: Pierre Habouzit <[email-masked]>
---
 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