From: robertl Date: Sun, 7 May 2006 20:30:05 +0000 (+0000) Subject: Axim fix for Windows. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~2845 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=48f6ca48d658e9d32880ba38724bceb7a15aba50;p=gpsbabel.git Axim fix for Windows. Magprotoc: deal with COMx (x>9) silliness on Windows. --- diff --git a/gpsbabel/axim_gpb.c b/gpsbabel/axim_gpb.c index 9a16fcfc5..49103be37 100644 --- a/gpsbabel/axim_gpb.c +++ b/gpsbabel/axim_gpb.c @@ -141,7 +141,7 @@ axim_gpb_read(void) char buff[RECORD_LEN]; route_head *track = NULL; size_t bytes; - off_t filesize, left; + long filesize, left; fseek(fin, 0, SEEK_END); filesize = ftell(fin); diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index b48f428f5..fd75e9bcb 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -524,15 +524,20 @@ int terminit(const char *portname, int create_ok) { DCB tio; + char *xname = xstrdup("\\\\.\\\\"); COMMTIMEOUTS timeout; - is_file = 0; + is_file = 0; + + xname = xstrappend(xname, portname); + if (xname[strlen(xname)-1] == ':') + xname[strlen(xname)-1] = 0; xCloseHandle(comport); - comport = CreateFile(portname, GENERIC_READ|GENERIC_WRITE, 0, NULL, + comport = CreateFile(xname, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - + fprintf(stderr, "Comport: %p %s\n", comport, xname); if (comport == INVALID_HANDLE_VALUE) { goto try_as_file; }