mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
CYGWIN: Add support for "COM*" naming.
This commit is contained in:
parent
3c7c865e59
commit
bdca5a27ec
1 changed files with 13 additions and 0 deletions
|
|
@ -492,6 +492,19 @@ void options_parse_final(int argc, char *argv[])
|
||||||
optind = 1; // Reset option index to restart scanning of argv
|
optind = 1; // Reset option index to restart scanning of argv
|
||||||
options_parse(argc, argv);
|
options_parse(argc, argv);
|
||||||
|
|
||||||
|
#ifdef __CYGWIN__
|
||||||
|
unsigned char portnum;
|
||||||
|
char *tty_win;
|
||||||
|
if ( ((strncmp("COM", tty_device, 3) == 0)
|
||||||
|
|| (strncmp("com", tty_device, 3) == 0) )
|
||||||
|
&& (sscanf(tty_device + 3, "%hhu", &portnum) == 1)
|
||||||
|
&& (portnum > 0) )
|
||||||
|
{
|
||||||
|
asprintf(&tty_win, "/dev/ttyS%hhu", portnum - 1);
|
||||||
|
tty_device = tty_win;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Restore tty device */
|
/* Restore tty device */
|
||||||
option.tty_device = tty_device;
|
option.tty_device = tty_device;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue