Skip to content

Commit

Permalink
[Bug #668662] Patch from Pearu Pearson: if a C source file is
Browse files Browse the repository at this point in the history
    specified with an absolute path, the object file is also
    written to an absolute path.  The patch drops the drive and
    leading '/' from the source path, so a path like /path/to/foo.c
    results in an object file like build/temp.i686linux/path/to/foo.o.
  • Loading branch information
akuchling committed Feb 26, 2003
1 parent 72cbcb8 commit 5daaf7c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,8 @@ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
obj_names = []
for src_name in source_filenames:
base, ext = os.path.splitext(src_name)
base = os.path.splitdrive(base)[1] # Chop off the drive
base = base[os.path.isabs(base):] # If abs, chop off leading /
if ext not in self.src_extensions:
raise UnknownFileError, \
"unknown file type '%s' (from '%s')" % (ext, src_name)
Expand Down

0 comments on commit 5daaf7c

Please sign in to comment.