URL:
<http://savannah.gnu.org/bugs/?30312>
Summary: $(abspath ...) fails with Windows UNC path (with
fix)
Project: make
Submitted by: None
Submitted on: Thu 01 Jul 2010 01:03:42 PM UTC
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: None
Operating System: MS Windows
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
Hi,
When providing $(abspath ...) with an - already absolute - UNC paths then the
starting_direcory gets incorrectly prepended.
The fix is to replace
#ifdef HAVE_DOS_PATHS
#define IS_ABSOLUTE(n) (n[0] && n[1] == ':')
#define ROOT_LEN 3
with
#ifdef HAVE_DOS_PATHS
#define IS_ABSOLUTE(n) (n[0] && n[1] == ':' || IS_PATHSEP(n[0]) &&
IS_PATHSEP(n[1]))
#define ROOT_LEN 3
and
#ifdef HAVE_DOS_PATHS
if (!IS_PATHSEP(apath[2]))
{
/* Convert d:foo into d:./foo and increase root_len. */
apath[2] = '.';
apath[3] = '/';
dest++;
root_len++;
/* strncpy above copied one character too many. */
name--;
}
else
apath[2] = '/'; /* make sure it's a forward slash */
#endif
with
#ifdef HAVE_DOS_PATHS
if (IS_PATHSEP(apath[0]))
{
/* Convert \\foo into //foo and decrease root_len. */
apath[0] = '/';
apath[1] = '/';
dest--;
root_len--;
/* strncpy above copied one character too many. */
name--;
}
else
{
if (!IS_PATHSEP(apath[2]))
{
/* Convert d:foo into d:./foo and increase root_len. */
apath[2] = '.';
apath[3] = '/';
dest++;
root_len++;
/* strncpy above copied one character too many. */
name--;
}
else
apath[2] = '/'; /* make sure it's a forward slash */
}
#endif
Please find attached the fixed source of abspath() for your convenience.
Oliver Schmidt - oliv.schmidt(at)sap.com
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 01 Jul 2010 01:03:42 PM UTC Name: abspath.c Size: 3kB By: None
Fixed source of abspath()
<http://savannah.gnu.org/bugs/download.php?file_id=20866>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30312>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make