[PATCH] Small regresson when series file is empty.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pierre Habouzit <madcoder@xxxxxxxxxx>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux