Fix what I broke in r484. Patch from Kosmaty in issue 34. Thanks!
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 21 Dec 2009 00:13:56 +0000 (00:13 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 21 Dec 2009 00:13:56 +0000 (00:13 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@506 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

src/opkg-cl.c

index f1c8f61853fd86ca17be47f7ea03efe2cc3c56b9..1f3a0ae878dd7e564372c01f7fd4cbd63b67c163 100644 (file)
@@ -258,7 +258,7 @@ usage()
 int
 main(int argc, char *argv[])
 {
-       int opts;
+       int opts, err = -1;
        char *cmd_name;
        opkg_cmd_t *cmd;
        int nocheckfordirorfile = 0;
@@ -322,15 +322,8 @@ main(int argc, char *argv[])
                usage();
        }
 
-       if (opkg_cmd_exec(cmd, argc - opts, (const char **) (argv + opts)))
-               goto err2;
+       err = opkg_cmd_exec(cmd, argc - opts, (const char **) (argv + opts));
 
-       print_error_list();
-       free_error_list();
-
-       return 0;
-
-err2:
 #ifdef HAVE_CURL
        opkg_curl_cleanup();
 #endif
@@ -341,5 +334,5 @@ err0:
        print_error_list();
        free_error_list();
 
-       return -1;
+       return err;
 }