diff options
author | imp <imp@FreeBSD.org> | 1998-07-01 19:56:17 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1998-07-01 19:56:17 +0000 |
commit | cf3db5046cd8de7cccf7595424b7bcf86e816475 (patch) | |
tree | 75574457c7a24c79aa0a61257e30200677dc31c9 /usr.bin/doscmd/config.c | |
parent | 66357b6a9fe31c229e447c9920cfd10ce8b44f98 (diff) | |
download | FreeBSD-src-cf3db5046cd8de7cccf7595424b7bcf86e816475.zip FreeBSD-src-cf3db5046cd8de7cccf7595424b7bcf86e816475.tar.gz |
Make sourcer's main program execute in X mode.
o Make the dos emulation treat c: and C: the same way. Sourcer was doing
a chdir("c:\\") rather than a chdir("C:\\");
o use drlton() in all places where we used to use -'A' so that we're always
case independent.
o use drntol() in all places where we used to use + 'A' for similar reasons
Diffstat (limited to 'usr.bin/doscmd/config.c')
-rw-r--r-- | usr.bin/doscmd/config.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/usr.bin/doscmd/config.c b/usr.bin/doscmd/config.c index c6463d8..823c00a 100644 --- a/usr.bin/doscmd/config.c +++ b/usr.bin/doscmd/config.c @@ -29,7 +29,7 @@ * * BSDI config.c,v 2.2 1996/04/08 19:32:22 bostic Exp * - * $Id: config.c,v 1.2 1996/09/18 16:12:24 miff Exp $ + * $Id: config.c,v 1.1 1997/08/09 01:42:35 dyson Exp $ */ #include <stdio.h> @@ -135,10 +135,8 @@ read_config(FILE *fp) if (isdigit(av[1][4])) { drive = atoi(&av[1][4]) - 1; - } else if (islower(av[1][4]) && av[1][5] == ':' && !av[1][6]) { - drive = av[1][4] - 'a'; - } else if (isupper(av[1][4]) && av[1][5] == ':' && !av[1][6]) { - drive = av[1][4] - 'A'; + } else if (isalpha(av[1][4]) && av[1][5] == ':' && !av[1][6]) { + drive = drlton(av[1][4]); } init_soft: drive = init_floppy(drive, atoi(av[3]), av[2]); @@ -149,10 +147,8 @@ init_soft: if (isdigit(av[1][4])) { drive = atoi(&av[1][4]) + 1; - } else if (islower(av[1][4]) && av[1][5] == ':' && !av[1][6]) { - drive = av[1][4] - 'a'; - } else if (isupper(av[1][4]) && av[1][5] == ':' && !av[1][6]) { - drive = av[1][4] - 'A'; + } else if (isalpha(av[1][4]) && av[1][5] == ':' && !av[1][6]) { + drive = drlton(av[1][4]); } init_hard: @@ -185,10 +181,7 @@ init_hard: fprintf(stderr, "Usage: assign [A-Z]: ...\n"); quit(1); } - if (isupper(av[1][0])) - drive = av[1][0] - 'A'; - else - drive = av[1][0] - 'a'; + drive = drlton(av[1][0]); if (ac == 3) { init_path(drive, (u_char *)av[2], 0); @@ -240,10 +233,7 @@ init_hard: fprintf(stderr, "Usage: boot [A: | C:]\n"); quit(1); } - if (isupper(av[1][0])) - bootdrive = av[1][0] - 'A'; - else - bootdrive = av[1][0] - 'a'; + bootdrive = drlton(av[1][0]); if (bootdrive != 0 && bootdrive != 2) { fprintf(stderr, "Boot drive must be either A: or C:\n"); quit(1); |