Alexander Best <alexbes...@wwu.de> writes:
>  
> +     if ((env_speed = getenv("BURNCD_SPEED")) != NULL) {
> +             if (strcasecmp("max", env_speed) == 0)
> +                     speed = CDR_MAX_SPEED;
> +             else
> +                     speed = atoi(env_speed) * 177;
> +             if (speed <= 0)
> +                     errx(EX_USAGE, "Invalid speed: %s", env_speed);
> +     }
> +
>       while ((ch = getopt(argc, argv, "def:Flmnpqs:tv")) != -1) {
>               switch (ch) {
>               case 'd':

You realize you're duplicating 6 lines of non-trivial code for no good
reason?

env_speed = getenv("BURNCD_SPEED");

while ((ch = getopt(...)) != -1) {
    switch (ch) {
    case 's':
        env_speed = optarg;
        break;
    ...
    }
}

if (env_speed != NULL) {
    if (strcasecmp...) {
        ...
    }
}

DES
-- 
Dag-Erling Smørgrav - d...@des.no
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to