contrib/lar: small fixes in cli.c
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 6 Apr 2009 02:50:29 +0000 (02:50 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 6 Apr 2009 02:50:29 +0000 (02:50 +0000)
contrib/lar/cli.c

index 026150e79ed128702df7c71e3a871bba2cee04ef..2b5e08891274c0a5d0dd583819ebcb96a00ca92d 100644 (file)
@@ -33,17 +33,19 @@ int do_print_index( lar_archive *ar )
 int main( int argc, const char* argv[] )
 {
        lar_archive *ar;
-       
+       int stat = 0;
+
        if( argv[1] != NULL )
        {
                if( (ar = lar_open(argv[1])) != NULL )
                {
                        if( argv[2] )
-                               return do_print_member(ar, argv[2]);
+                               stat = do_print_member(ar, argv[2]);
                        else
-                               return do_print_index(ar);
+                               stat = do_print_index(ar);
 
                        lar_close(ar);
+                       return stat;
                }
                else
                {
@@ -51,7 +53,7 @@ int main( int argc, const char* argv[] )
                }
        }
        else
-    {
+       {
                printf("Usage: lar <archive> [<member>]\n");
                return 1;
        }