]> granicus.if.org Git - jq/commitdiff
Fix serious bug in handling of --argfile 157/head
authorNicolas Williams <nico@cryptonector.com>
Tue, 18 Jun 2013 03:32:44 +0000 (22:32 -0500)
committerNicolas Williams <nico@cryptonector.com>
Wed, 19 Jun 2013 00:05:52 +0000 (19:05 -0500)
main.c

diff --git a/main.c b/main.c
index e7e4e0936b091ac40852bdbdfafff6a930e07ec3..3f82b46039ea4d341d281fbeeecada7235652e1a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -202,7 +202,7 @@ int main(int argc, char* argv[]) {
         jv_free(data);
         return 1;
       }
-      if (jv_array_length(data) == 1)
+      if (jv_get_kind(data) == JV_KIND_ARRAY && jv_array_length(jv_copy(data)) == 1)
           data = jv_array_get(data, 0);
       arg = jv_object_set(arg, jv_string("value"), data);
       program_arguments = jv_array_append(program_arguments, arg);