Fix "Evaluate 'script' in the global scope"
authorFreddie Chopin <freddie.chopin@gmail.com>
Sat, 22 Oct 2011 07:53:55 +0000 (09:53 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 24 Oct 2011 17:40:52 +0000 (17:40 +0000)
This fixes commit Evaluate 'script' in the global scope. It caused
Windows builds behave differently than before because path was evaluated twice
and backslashes from Windows' paths got unescaped and effectively wiped out.
Configs could only be passed with "-f ../dir/config.cfg" or "-f
..\\dir\\config.cfg" instead of usual "-f dir/config.cfg" (or using backslash)
as previously.

Change-Id: I13b4abac6dbe6d770cc11a4e61c9421ef340da83
Author: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/40
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/helper/startup.tcl

index e2ea27d..a7c0d58 100644 (file)
@@ -55,7 +55,7 @@ add_help_text find "print full path to file according to OpenOCD search rules"
 
 # Find and run a script
 proc script {filename} {
-       uplevel #0 source [find $filename]
+       uplevel #0 [list source [find $filename]]
 }
 add_help_text script "filename of OpenOCD script (tcl) to run"
 add_usage_text script "<file>"