Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix USB keyboard access from EE #697

Merged
merged 1 commit into from
Dec 12, 2024
Merged
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
31 changes: 19 additions & 12 deletions ee/libcglue/src/cwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,26 @@ int __get_drive(const char *dev, enum SeparatorType *usePOSIXSeparator)
devname_len -= 1;
}

/* We need to check if driver is cdrom because those one use \ as separator */
if (devname_len == 5 && (memcmp(d, "cdrom", 5) == 0))
*usePOSIXSeparator = SeparatorTypePOSIX;
switch (devname_len)
{
*usePOSIXSeparator = SeparatorTypeWindows;
}
/* We need to check if drive is rom or hdd because those one don't have separator */
else if (devname_len == 3 && ((memcmp(d, "rom", 3) == 0) || (memcmp(d, "hdd", 3) == 0)))
{
*usePOSIXSeparator = SeparatorTypeNone;
}
else
{
*usePOSIXSeparator = SeparatorTypePOSIX;
case 3:
/* These drivers don't have separator */
if ((memcmp(d, "rom", devname_len) == 0) || (memcmp(d, "hdd", devname_len) == 0))
*usePOSIXSeparator = SeparatorTypeNone;
break;
case 5:
/* These drivers use \ as separator */
if ((memcmp(d, "cdrom", devname_len) == 0))
*usePOSIXSeparator = SeparatorTypeWindows;
break;
case 6:
/* These drivers don't have separator */
if ((memcmp(d, "usbkbd", devname_len) == 0))
*usePOSIXSeparator = SeparatorTypeNone;
break;
default:
break;
}

/* Return the length of the whole device name portion, including:
Expand Down
Loading