Opened 8 years ago

Closed 8 years ago

#14800 closed defect (fixed)

[cla][patch] absolute path given for profile failes on windows

Reported by: Rawld Gill Owned by: Rawld Gill
Priority: high Milestone: 1.7.2
Component: BuildSystem Version: 1.7.2rc1
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

works OK on *nix, but windows path normalization appears to fail; particularly if there is a drive letter in the path

Attachments (1)

14800.patch (408 bytes) - added by Patrick Ruzand 8 years ago.
patch by Patrick Ruzand (IBM, CCLA)

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by Rawld Gill

Milestone: tbd1.8
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 8 years ago by cjolif

Cc: cjolif added

Changed 8 years ago by Patrick Ruzand

Attachment: 14800.patch added

patch by Patrick Ruzand (IBM, CCLA)

comment:3 Changed 8 years ago by Patrick Ruzand

Here is a possible patch. The patch is very simple but review more than welcome... The problem I found is that getAbsolutePath() function (fileUtils.js) does not take into account the Windows filesystem syntax when checking whether it's an absolute path or not. This result in concatanating the base path with the given filename (which is absolute), giving something like: c:/a/path/to/buildscript/c:/a/path/to/the/file.profile

Indeed:

getAbsolutePath= function(src, base) {
    src= cleanupPath(src);
    if (src.charAt(0)!="/") { //////////// <<<<< UNIX-only !!!
        src= catPath(base, src);
    }
    return compactPath(src);
},

Instead, it should check the path using the isAbsolutePath function :

getAbsolutePath= function(src, base) {
	src= cleanupPath(src);
	if (!isAbsolutePath(src)) {
		src= catPath(base, src);
	}
	return compactPath(src);
},

comment:4 Changed 8 years ago by cjolif

Milestone: 1.81.7.2

rcgill, if Patrick's patch is ok with you, can Patrick (or you) commit it in 1.7.2? Or at least in 1.7.3? Thanks.

comment:5 Changed 8 years ago by Colin Snover

Summary: absolute path given for profile failes on windows[cla][patch] absolute path given for profile failes on windows

comment:6 Changed 8 years ago by Rawld Gill

In [27887]:

improved path computations for windows; thanks pruzand; refs #14800; !strict

comment:7 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [27888]:

backport [27887]; fixes #14800; !strict

Note: See TracTickets for help on using tickets.