Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005475OCamlOCaml generalpublic2012-01-13 17:212013-08-31 12:44
Reporternodakai 
Assigned Tolefessan 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.13.0+dev 
Target VersionFixed in Version3.13.0+dev 
Summary0005475: Wrapper script for interpreted LablTk wrongly handles command line parameters
DescriptionI found a problematic code in the wrapper shell script for interpreted LablTk.

$ cat `which labltk`
#!/bin/sh
exec /home/nodakai/ocaml/lib/ocaml/labltk/labltktop -I /home/nodakai/ocaml/lib/ocaml/labltk $*

Here, the last $* should be "$@" according to sh specification.
http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html [^]

Currently it cannot accept an argument containing spaces.
Steps To Reproduce$ cat labltk_space.ml
let main argv =
    let top = Tk.openTk () in
    Wm.title_set top argv.(1);
    Tk.mainLoop ()
;; main Sys.argv

$ labltk labltk_space.ml "10 20"
+---------+
[ 10 ]
+---------+
| |
| |
+---------+
Additional InformationA natively compiled version doesn't suffer from the above problem

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

This problem is also in trunk

http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/trunk/otherlibs/labltk/lib/Makefile?revision=HEAD&view=markup [^]

I attached a patch for trunk.
TagsNo tags attached.
Attached Filespatch file icon labltk.patch [^] (567 bytes) 2012-01-13 17:21 [Show Content]

- Relationships

-  Notes
(0006706)
lefessan (developer)
2012-01-17 22:49

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

- Issue History
Date Modified Username Field Change
2012-01-13 17:21 nodakai New Issue
2012-01-13 17:21 nodakai File Added: labltk.patch
2012-01-17 22:49 lefessan Note Added: 0006706
2012-01-17 22:49 lefessan Status new => resolved
2012-01-17 22:49 lefessan Fixed in Version => 3.13.0+dev
2012-01-17 22:49 lefessan Resolution open => fixed
2012-01-17 22:49 lefessan Assigned To => lefessan
2013-08-31 12:44 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker