octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Canonicalize bug?


From: PhilipNienhuis
Subject: Re: Canonicalize bug?
Date: Mon, 31 Aug 2015 09:58:20 -0700 (PDT)

Dmitri A. Sergatskov wrote
> On Mon, Aug 31, 2015 at 4:07 AM, Juan Pablo Carbajal <

> ajuanpi+dev@

> >
> wrote:
> 
>> Dear gnulib devs,
>>
>> In the GNU Octave community with run into a problem with canonicalize
>> functions.
>> It is not clear yet, but it seems that '/' is used for path regardless
>> of the platform.
>> One of our devs, Rik, reported this recently
>>
>> https://savannah.gnu.org/bugs/?45816#comment3
>>
>> Is this a bug in gnulib?
>>
>> Thanks
>>
>>
> ​Why it is a problem? I thought windows can use "\" and "/"
> interchangeably.​
> 
> ​I.e. ​ans = D:\folderA/folderB/file_a.txt is a correct PATH in windows.

You git it (a little bit) wrong in  two ways:

1.  '\' and '/' cannot be entered interchangeably everywhere in Windows:

-   "/' fileseps work fine in MSYS / Mingw and -to some extent- in windows
explorer.

-  cmd.exe / cmd32.exe (Windows'  "shell") only accepts '\' fileseps. 
Moreover, '/' is an option/parameter prefix there, much like '-' in *nix.  
AFAIU Octave's CLI is based on cmd32.exe but admittedly I do not know how
far it inherits cmd32 idiosyncrasies.

2.  (the more creepy issue)  If Octave harvests path names on Windows it
usually gets backslash fileseps (i.e, like in "pwd"). 
If these are mixed in a next step with forward slash fileseps, using e.g.,
canonicalize_file_name(), problems may occur.
That is exactly the gist of bug #45816.

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Canonicalize-bug-tp4672375p4672388.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]