summaryrefslogtreecommitdiff
path: root/lib/console.tcl
diff options
context:
space:
mode:
authorLibravatar Ansgar Röber <ansgar.roeber@rwth-aachen.de>2020-04-09 18:03:25 +0000
committerLibravatar Pratyush Yadav <me@yadavpratyush.com>2020-04-22 18:32:44 +0530
commit19195fbd73994d05abaa0a2976143da96b320f47 (patch)
tree5bfca451d4e4238151e3766db8d912d7295cadd1 /lib/console.tcl
parentMerge branch 'py/remove-tcloo' (diff)
downloadtgif-19195fbd73994d05abaa0a2976143da96b320f47.tar.xz
Subject: git-gui: fix syntax error because of missing semicolon
For some asynchronous operations, we build a chain of callbacks to execute when the operation is done. These callbacks are held in $after, and a new callback can be added by appending to $after. Once the operation is done, $after is executed as a script. But if we don't append a semi-colon after the procedure calls, they will appear to Tcl as arguments to the previous procedure's arguments. So, for example, if $after is "foo", and we just append "bar", then $after becomes "foo bar", and bar will be treated as an argument to foo. If foo does not accept any optional arguments, it would result in Tcl throwing an error. If instead we do append a semi-colon, $after will look like "foo;bar;", and these will be treated as two separate procedure calls. Before d9c6469 (git-gui: update status bar to track operations, 2019-12-01), this problem was masked because ui_ready/ui_status did accept an optional argument. In d9c6469, ui_ready stopped accepting an optional argument, and this error started showing up. Another instance of this problem is when a call to ui_status without a trailing semicolon. ui_status never accepted an optional argument to begin with, but the issue never managed to surface. So, fix these errors by making sure we always append a semi-colon after procedure calls when multiple callbacks are involved in $after. Helped-by: Pratyush Yadav <me@yadavpratyush.com> Signed-off-by: Ansgar Röber <ansgar.roeber@rwth-aachen.de>
Diffstat (limited to 'lib/console.tcl')
0 files changed, 0 insertions, 0 deletions