--- console-tools-0.3.3/vttools/resizecons.c.resizecons Wed Aug 25 23:13:26 1999 +++ console-tools-0.3.3/vttools/resizecons.c Sun Nov 7 10:45:40 1999 @@ -128,16 +128,18 @@ { NULL, 0, NULL, 0 } }; - while ( (c = getopt_long (argc, argv, "-vhc:r:l:", long_opts, NULL)) != EOF) + while ( (c = getopt_long (argc, argv, "vhc:r:l:", long_opts, NULL)) != EOF) { switch (c) { case 'h': usage(); exit(0); + break; case 'v': version(); exit(0); + break; case 'c': *cols = atoi(optarg); if (*cols == 0) @@ -161,41 +163,38 @@ *mode = MODE_VGALINES; break; case '?': + default: usage(); exit(1); + break; } } - if (argc == optind +1) /* COLSxROWS case */ + if (argc == (optind + 1)) /* COLSxROWS case */ { if (*rows || *cols) { - fprintf(stderr,_("%s: Invalid arguments"), + fprintf(stderr,_("%s: Invalid arguments\n"), progname); exit(1); } - if ((p = index (argv[optind],'x')) != 0) - { - *cols = atoi (argv[optind]); - *rows = atoi (p+1); - return; - } - else + if ((p = index (argv[optind],'x')) == NULL) { - fprintf(stderr,_("%s: Unrecognized argument"), + fprintf(stderr, _("%s: Unrecognized argument\n"), progname); exit(1); } + *cols = atoi (argv[optind]); + *rows = atoi (p+1); return; - } - if (argc == optind +2) /* COLS ROWS case */ + if (argc == (optind + 2)) /* COLS ROWS case */ { if (*rows || *cols) { - fprintf(stderr,_("%s: Invalid arguments"), + fprintf(stderr,_("%s: Invalid arguments\n"), progname); exit(1); } @@ -204,7 +203,7 @@ return; } - if (argc == optind && *rows && *cols) + if (argc == optind && ((*rows && *cols) || *mode == MODE_VGALINES)) return; fprintf (stderr, _("%s: bad number of arguments\n"),