From ee451be6a13dfcf3a5d95a1683dbc3289bd33418 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 9 Aug 2009 11:38:49 +0000 Subject: [PATCH] 2009-08-09 13:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtpathy/telepath.prg ! Fixed tp_open() to not add numeric port to passed portname. It's now only added to portname if it's not passed and default is used. On darwin, the portname isn't necessarily ending with a number. --- harbour/ChangeLog | 7 +++++++ harbour/contrib/hbtpathy/telepath.prg | 14 ++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b138bb7f8a..fcdab16f1d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-09 13:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbtpathy/telepath.prg + ! Fixed tp_open() to not add numeric port to passed portname. + It's now only added to portname if it's not passed and default + is used. On darwin, the portname isn't necessarily ending with + a number. + 2009-08-09 12:53 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtpathy/hbtpathy.hbc ! Added darwin to supported platforms. diff --git a/harbour/contrib/hbtpathy/telepath.prg b/harbour/contrib/hbtpathy/telepath.prg index 16c17a60a8..e5e98ef172 100644 --- a/harbour/contrib/hbtpathy/telepath.prg +++ b/harbour/contrib/hbtpathy/telepath.prg @@ -184,19 +184,9 @@ FUNCTION tp_open( nPort, nInSize, nOutSize, nBaud, nData, cParity, nStop, cPortn /* Serial ports name are made up of cPortName + nPort if nPort is not NIL */ #ifdef __PLATFORM__UNIX - DEFAULT cPortName TO "/dev/ttyS" + DEFAULT cPortName TO "/dev/ttyS" + iif( ISNUMBER( nPort ), hb_NToS( nPort - 1 ), "" ) #else - DEFAULT cPortName TO "COM" // Ok for Windows and OS/2 - #endif - - /* This way compatibility is retained for ports 1-4 on Windows and Linux, but, - should necessity arise, it is possible to simply pass a NIL on nPort and - a full name on cPortName - */ - #ifdef __PLATFORM__UNIX - cPortname := AllTrim( cPortname ) + iif( ISNUMBER( nPort ), hb_NToS( nPort - 1 ), "" ) - #else - cPortname := AllTrim( cPortname ) + iif( ISNUMBER( nPort ), hb_NToS( nPort ), "" ) + DEFAULT cPortName TO "COM" + iif( ISNUMBER( nPort ), hb_NToS( nPort ), "" ) #endif #ifdef __PLATFORM__UNIX