bugmake - Bugs: bug #30312, $(abspath ...) fails with Windows...

 
 

bug #30312: $(abspath ...) fails with Windows UNC path (with fix)

Submitted by:  None
Submitted on:  Thu 01 Jul 2010 01:03:42 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Eli Zaretskii <eliz>Open/Closed: Closed
Component Version: NoneOperating System: MS Windows
Fixed Release: 3.82Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 09 Jul 2010 11:42:34 AM UTC, comment #1:

I committed a slightly different fix for this problem.

Thanks.

Eli Zaretskii <eliz>
Project MemberIn charge of this item.
Thu 01 Jul 2010 01:03:42 PM UTC, original submission:

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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #20866:  abspath.c added by None (3KiB - text/plain - Fixed source of abspath())

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Updated the item)
  • -unavailable- added by eliz (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 06:10:50 AM UTCpsmithFixed Release4.0=>3.82
    Fri 09 Jul 2010 12:40:49 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>eliz
    Fri 09 Jul 2010 11:42:56 AM UTCelizOpen/ClosedOpen=>Closed
    Fri 09 Jul 2010 11:42:34 AM UTCelizFixed ReleaseNone=>4.0
    Thu 01 Jul 2010 01:03:42 PM UTCNoneAttached File-=>Added abspath.c, #20866

    Back to the top


    Powered by Savane 3.1-cleanup1