* Chdrive() changes the default drive. */
| 449 | * Chdrive() changes the default drive. |
| 450 | */ |
| 451 | void |
| 452 | chdrive(const char *str) |
| 453 | { |
| 454 | #define SELECTDISK 0x0E |
| 455 | char *ptr; |
| 456 | union REGS inregs; |
| 457 | char drive; |
| 458 | |
| 459 | if ((ptr = strchr(str, ':')) != (char *) 0) { |
| 460 | drive = toupper(*(ptr - 1)); |
| 461 | inregs.h.ah = SELECTDISK; |
| 462 | inregs.h.dl = drive - 'A'; |
| 463 | intdos(&inregs, &inregs); |
| 464 | } |
| 465 | return; |
| 466 | } |
| 467 | |
| 468 | /* Use the IOCTL DOS function call to change stdin and stdout to raw |
| 469 | * mode. For stdin, this prevents MSDOS from trapping ^P, thus |