From 36cc26194c8a2e6b4b590a1fe241232a7bbb3183 Mon Sep 17 00:00:00 2001 From: msv Date: Fri, 21 Apr 2017 17:18:14 +0300 Subject: [PATCH] 0028673: getsourcefile Draw command return different output on Linux and Windows platforms The method Draw_Interpretor::add() has been corrected so that the command getsourcefile returned the relative path starting with "src" without leading "/" on all platforms. --- src/Draw/Draw_Interpretor.cxx | 2 ++ tests/demo/draw/getsource | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Draw/Draw_Interpretor.cxx b/src/Draw/Draw_Interpretor.cxx index d84973ea25..025df3183f 100644 --- a/src/Draw/Draw_Interpretor.cxx +++ b/src/Draw/Draw_Interpretor.cxx @@ -311,6 +311,8 @@ void Draw_Interpretor::add (const Standard_CString theCommandName, aPath.SetNode (""); TCollection_AsciiString aSrcPath; aPath.SystemName (aSrcPath); + if (aSrcPath.Value(1) == '/') + aSrcPath.Remove(1); Tcl_SetVar2 (myInterp, "Draw_Files", aName, aSrcPath.ToCString(), TCL_GLOBAL_ONLY); } diff --git a/tests/demo/draw/getsource b/tests/demo/draw/getsource index 4222254647..acfe3bbac1 100755 --- a/tests/demo/draw/getsource +++ b/tests/demo/draw/getsource @@ -1,13 +1,7 @@ -puts "TODO OCC28773 Windows: Error: command 'getsourcefile pload' returned" - # test for command getsource # check that path returned for command pload is as expected -if { [checkplatform -windows] } { - set expected src/Draw/Draw_PloadCommands.cxx -} else { - set expected /src/Draw/Draw_PloadCommands.cxx -} +set expected src/Draw/Draw_PloadCommands.cxx set path [lindex [getsourcefile pload] 1] if { [string compare $path $expected] } { puts "Error: command 'getsourcefile pload' returned '$path' while expected '$expected'" -- 2.39.5