but that does seem to be a bug in ghc-pkg-inplace.hs,
so perhaps that should be fixed first, and then we could use '*' instead of '.' (even though it
isn't full globbing, '*' is only interpreted at string ends).
the problem is not specific to ghc-pkg-inplace, but is
shared by all ghc mingw programs using getArgs:
./main '*' -- this does not protect from globbing!
moreover, this issue does not show when using the same
executable from cmd.exe, only when using it from cygwin's
bash!
i found this old message:
Re: command line globbing
http://www.cygwin.com/ml/cygwin/1999-11/msg00052.html
and this does seem to have interesting effects, which
might have an impact on other troublesome ghc windows
quoting issues in build system and elsewhere.
in the following log, note how turning off globbing by
linking the file recommended in the message above only
affects the quoted globbing, not the unquoted one.
at first glance, it looks as if this makes the behaviour
more consistent between running the executable in
cmd.exe vs running it in cygwin bash..
could someone with more mingw experience please
investigate? is this a solution, or a hack with its own
issues? or am i misunderstanding the whole situation?-)
claus
$ cat tst.hs
import System.Environment; main = getArgs >>= print
$ ghc --make tst.hs c:/MinGW/lib/CRT_noglob.o
[1 of 1] Compiling Main ( tst.hs, tst.o )
Linking tst.exe ...
$ ./tst.exe *
["Main.hi","Main.hs","Main.hs.diff","Main.o","Makefile","Version.hi","Version.hs","Version.o","ghc-p
kg-inplace.exe","ghc-pkg-inplace.hi","ghc-pkg-inplace.hs","ghc-pkg-inplace.o","ghc-pkg.exe","main.ex
e","tst.c","tst.exe","tst.hi","tst.hs","tst.o"]
$ ./tst.exe '*'
["*"]
$ rm tst.{hi,o,exe}
$ ghc --make tst.hs
[1 of 1] Compiling Main ( tst.hs, tst.o )
Linking tst.exe ...
$ ./tst.exe *
["Main.hi","Main.hs","Main.hs.diff","Main.o","Makefile","Version.hi","Version.hs","Version.o","ghc-p
kg-inplace.exe","ghc-pkg-inplace.hi","ghc-pkg-inplace.hs","ghc-pkg-inplace.o","ghc-pkg.exe","main.ex
e","tst.c","tst.exe","tst.hi","tst.hs","tst.o"]
$ ./tst.exe '*'
[".depend",".depend.bak",".ghc-pkg-inplace.hs.swp",".Main.hs.swp","ghc-pkg-inplace.exe","ghc-pkg-inp
lace.hi","ghc-pkg-inplace.hs","ghc-pkg-inplace.o","ghc-pkg.exe","main.exe","Main.hi","Main.hs","Main
.hs.diff","Main.o","Makefile","tst.c","tst.exe","tst.hi","tst.hs","tst.o","Version.hi","Version.hs",
"Version.o"]
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc