[PATCH v2 7/7] grep: fix string_list_append calls

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

 



This updates string_list_append calls added in the new grep -O
functionality to have the string list as the first argument.

Signed-off-by: Julian Phillips <julian@xxxxxxxxxxxxxxxxx>
---
 builtin/grep.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/grep.c b/builtin/grep.c
index 0374a76..232cd1c 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -564,7 +564,7 @@ static void append_path(struct grep_opt *opt, const void *data, size_t len)
 
 	if (len == 1 && *(const char *)data == '\0')
 		return;
-	string_list_append(xstrndup(data, len), path_list);
+	string_list_append(path_list, xstrndup(data, len));
 }
 
 static void run_pager(struct grep_opt *opt, const char *prefix)
@@ -1005,7 +1005,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		opt.null_following_name = 1;
 		opt.output_priv = &path_list;
 		opt.output = append_path;
-		string_list_append(show_in_pager, &path_list);
+		string_list_append(&path_list, show_in_pager);
 		use_threads = 0;
 	}
 
@@ -1080,7 +1080,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 			strbuf_addf(&buf, "+/%s%s",
 					strcmp("less", pager) ? "" : "*",
 					opt.pattern_list->pattern);
-			string_list_append(buf.buf, &path_list);
+			string_list_append(&path_list, buf.buf);
 			strbuf_detach(&buf, NULL);
 		}
 	}
-- 
1.7.0.4

--
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]