[Flac-dev] [PATCH 5/5]: Make metaflac exit nonzero on bad option

Joshua Kwan joshk at triplehelix.org
Mon Jan 8 17:11:04 PST 2007


This patch causes metaflac to exit nonzero if an illegal option was
entered.

-- 
Joshua Kwan

--- flac-1.1.2/src/metaflac/options.c~	2006-05-27 23:13:33.000000000 -0600
+++ flac-1.1.2/src/metaflac/options.c	2006-05-27 23:15:07.000000000 -0600
@@ -229,7 +229,7 @@
 		}
 	}
 
-	return !had_error;
+	return had_error;
 }
 
 void free_options(CommandLineOptions *options)
--- flac-1.1.2/src/metaflac/main.c~	2006-05-27 23:07:51.000000000 -0600
+++ flac-1.1.2/src/metaflac/main.c	2006-05-27 23:14:47.000000000 -0600
@@ -32,7 +32,7 @@
 	setlocale(LC_ALL, "");
 	init_options(&options);
 
-	if(parse_options(argc, argv, &options))
+	if ((ret = parse_options(argc, argv, &options)) == 0)
 		ret = !do_operations(&options);
 
 	free_options(&options);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 881 bytes
Desc: Digital signature
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20070108/cb7844d3/attachment.pgp


More information about the Flac-dev mailing list