Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapper script for interpreted LablTk wrongly handles command line parameters #5475

vicuna opened this issue Jan 13, 2012 · 1 comment


Copy link

@vicuna vicuna commented Jan 13, 2012

Original bug ID: 5475
Reporter: nodakai
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2013-08-31T10:44:21Z)
Resolution: fixed
Priority: low
Severity: minor
Version: 3.13.0+dev
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

I found a problematic code in the wrapper shell script for interpreted LablTk.

$ cat which labltk
exec /home/nodakai/ocaml/lib/ocaml/labltk/labltktop -I /home/nodakai/ocaml/lib/ocaml/labltk $*

Here, the last $* should be "$@" according to sh specification.

Currently it cannot accept an argument containing spaces.

Steps to reproduce

$ cat
let main argv =
let top = Tk.openTk () in
Wm.title_set top argv.(1);
Tk.mainLoop ()
;; main Sys.argv

$ labltk "10 20"
[ 10 ]
| |
| |

Additional information

A natively compiled version doesn't suffer from the above problem

$ ocamlopt.opt -I +labltk labltk.cmxa -o labltk_space.exe
$ ./labltk_space.exe "10 20"
[ 10 20 ]
| |
| |

This problem is also in trunk

I attached a patch for trunk.

File attachments

Copy link

@vicuna vicuna commented Jan 17, 2012

Comment author: @lefessan

I applied the patch, tested it, and also modified that tries to generate the same file (commit r12032 in SVN trunk).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants