MCPcopy Create free account
hub / github.com/NetHack/NetHack / chdrive

Function chdrive

sys/msdos/msdos.c:451–466  ·  view source on GitHub ↗

* Chdrive() changes the default drive. */

Source from the content-addressed store, hash-verified

449 * Chdrive() changes the default drive.
450 */
451void
452chdrive(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

Callers 2

msexitFunction · 0.50
chdirxFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected