Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion shell/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ char switchar(void)
}
#endif

unsigned isdrive(unsigned char cc) {
if (isalpha(cc))
return 1;
if ((cc - 'A') < 32)
return 1;
return 0;
}

void execute(char *first, char *rest, int lh_lf)
{
/*
Expand All @@ -177,7 +185,7 @@ void execute(char *first, char *rest, int lh_lf)
assert(rest);

/* check for a drive change (not for loadhigh/loadfix) */
if (!lh_lf && (strcmp(first + 1, ":") == 0) && isalpha(*first))
if (!lh_lf && (strcmp(first + 1, ":") == 0) && isdrive(*first))
{
changeDrive(*first);
return;
Expand Down
6 changes: 3 additions & 3 deletions suppl/src/dfnpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ char *dfnpath(int drive)
DBG_ENTER("dfnpath", Suppl_dfn)
DBG_ARGUMENTS( ("drive=%u ('%c')", drive, drive < 32? '.': drive) )

if(isupper(drive)) drive -= 'A' - 1;
else if(islower(drive)) drive -= 'a' - 1;
else if((unsigned)drive > 32) {
if (islower(drive)) drive -= 'a' - 'A';
if (drive >= 'A') drive -= 'A' - 1;
if ((unsigned)drive > 32) {
eno_set( ENODEV);
DBG_RETURN_S( 0)
}
Expand Down
Loading