expr.y.diff

joerg, 01/20/2009 01:07 PM

Download (844 Bytes)

View differences:

expr.y 20 Jan 2009 12:56:52 -0000
440 440
	va_end(arg);
441 441
}
442 442

  
443
static void
444
usage(void)
445
{
446
	(void)fprintf(stderr, "usage: %s expression\n", getprogname());
447
	exit(2);
448
}
449

  
443 450
int
444 451
main(int argc, const char * const *argv)
445 452
{
446 453
	setprogname(argv[0]);
447 454
	(void)setlocale(LC_ALL, "");
448 455

  
449
	if (argc == 1) {
450
		(void)fprintf(stderr, "usage: %s expression\n",
451
		    getprogname());
452
		exit(2);
453
	}
454

  
455
	av = argv + 1;
456
	if (argc > 1 && strcmp(argv[1], "--"))
457
		av = argv + 1;
458
	else if (argc > 2)
459
		av = argv + 2;
460
	else
461
		usage();
456 462

  
457 463
	exit(yyparse());
458 464
	/* NOTREACHED */