Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#449 closed defect (fixed)

csc doesn't handle relative paths correctly

Reported by: Moritz Heidkamp Owned by:
Priority: major Milestone: 4.9.0
Component: compiler Version: 4.6.x
Keywords: sorry for the ticket flood Cc:
Estimated difficulty:


Passing a relative path containing more than one ".." leads to csc not expanding the path correctly. Example session:

$ mkdir foo
$ echo "(print 'foo)" > foo.scm
$ mkdir a
$ cd a
$ csc ../foo.scm # this works
$ mkdir b
$ cd b
syn@gut /tmp/a/b $ csc ../../foo.scm

Error: Can not open file "foo.scm"

Error: shell command terminated with non-zero exit status 256: /usr/bin/chicken foo.scm -output-file foo.c

Change History (5)

comment:1 Changed 14 years ago by sjamaan

The problem is that the compiler runs normalize-pathname to resolve symlinks and other references like "~". This also simply strips off the leading ..

I'd suggest removing the call to normalize-pathname at all, but I'm afraid that will probably completely break stuff for Windows, won't it?

comment:2 Changed 14 years ago by sjamaan

s/the compiler/csc/ btw. (chicken ../../foo.scm works fine)

comment:3 Changed 14 years ago by felix winkelmann

Resolution: fixed
Status: newclosed

I have tried to repair normalize-pathname, please give it a try.

comment:4 Changed 13 years ago by felix winkelmann


Milestone 4.7.0 deleted

comment:5 Changed 12 years ago by felix winkelmann


Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.