[Mesa-dev] [PATCH 6/8 v.2] glcpp: Add --disable-line-continuations argument to standalone glcpp

Carl Worth cworth at cworth.org
Mon Jan 7 13:20:27 PST 2013


Kenneth Graunke <kenneth at whitecape.org> writes:
> How about:
>
> 	if (optind == argc - 1) {
> 		filename = argv[optind];
> 	} else if (optind < argc) {
> 		usage ();
> 		exit (1);
> 	}

Thanks, that does catch an additional usage error that was let through
previously. I've updated this to also emit a detailed error about the
message, (and re-ordered the conditions). Here's what I'll plan to push:

	if (optind + 1 < argc) {
		printf ("Unexpected argument: %s\n", argv[optind+1]);
		usage ();
		exit (1);
	}
	if (optind < argc) {
		filename = argv[optind];
	}

-Carl

-- 
carl.d.worth at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130107/bcbe70a2/attachment.pgp>


More information about the mesa-dev mailing list