From e103343644188ddddb3678f0568d150ca56f59e3 Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Mon, 25 Feb 2008 23:07:39 -0500 Subject: rev-parse: fix potential bus error with --parseopt option spec handling A non-empty line containing no spaces should be treated by --parseopt as an option group header, but was causing a bus error. Also added a test script for rev-parse --parseopt. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano --- builtin-rev-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-rev-parse.c') diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c index b9af1a5a55..90dbb9d7c1 100644 --- a/builtin-rev-parse.c +++ b/builtin-rev-parse.c @@ -315,7 +315,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix) s = strchr(sb.buf, ' '); if (!s || *sb.buf == ' ') { o->type = OPTION_GROUP; - o->help = xstrdup(skipspaces(s)); + o->help = xstrdup(skipspaces(sb.buf)); continue; } -- cgit v1.2.3