# windows: Fix path for file sanitizationClosedPublicActions

Authored by walac on Jun 23 2020, 8:21 AM.

# Details

Reviewers
 vtorri felipealmeida jptiz stefan_schmidt
Commits
rEFLe797634755ae: windows: Fix path for file sanitization
Summary
```> c:\
> cd /windows```

Are valid paths. Paths starting with '\' or '/' should be considered
absolute paths.

Test Plan

meson test eina

# Diff Detail

Repository
rEFL core/efl
Lint
 Automatic diff as part of commit; lint not applicable.
Unit
 Automatic diff as part of commit; unit tests not applicable.
walac created this revision.Jun 23 2020, 8:21 AM
Herald added a project: efl. Jun 23 2020, 8:21 AM
Herald added subscribers: committers, reviewers, cedric.
walac requested review of this revision.Jun 23 2020, 8:21 AM

i've looked at https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths and i indeed see it can begin with \ (but not /) :

"A file name is relative to the current directory if it does not begin with one of the following etc... "
"A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path."

i don't know if you should also consider /

walac added a comment.Jun 23 2020, 9:42 AM

i've looked at https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths and i indeed see it can begin with \ (but not /) :

"A file name is relative to the current directory if it does not begin with one of the following etc... "
"A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path."

i don't know if you should also consider /

I didn't look at official docs, however if you go to the command prompt and type "cd /Windows" it works.

i've looked at https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths and i indeed see it can begin with \ (but not /) :

"A file name is relative to the current directory if it does not begin with one of the following etc... "
"A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path."

i don't know if you should also consider /

It's common for applications ported to windows to consider both \ and / (e.g. neovim). Maybe it would be a nice idea if EFL accepted both as well? At least in Windows.

i've looked at https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths and i indeed see it can begin with \ (but not /) :

"A file name is relative to the current directory if it does not begin with one of the following etc... "
"A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path."

i don't know if you should also consider /

It's common for applications ported to windows to consider both \ and / (e.g. neovim). Maybe it would be a nice idea if EFL accepted both as well? At least in Windows.

we do almost nothing about that. Usually, when one passes a path to a Windows file API, the API changes all the slashes to backslashes

i've looked at https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths and i indeed see it can begin with \ (but not /) :

"A file name is relative to the current directory if it does not begin with one of the following etc... "
"A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path."

i don't know if you should also consider /

It's common for applications ported to windows to consider both \ and / (e.g. neovim). Maybe it would be a nice idea if EFL accepted both as well? At least in Windows.

we do almost nothing about that. Usually, when one passes a path to a Windows file API, the API changes all the slashes to backslashes

Hm, so you mean that in EFL's point of view, it doesn't matter if the path is with \\ or /, the only one who would and should care is the underlying OS API (which will then report if the path is or not valid)?

and if an application is not working correctly wrt (back)slashes, then i consider this as a bug

i've looked at https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths and i indeed see it can begin with \ (but not /) :

"A file name is relative to the current directory if it does not begin with one of the following etc... "
"A single backslash, for example, "\directory" or "\file.txt". This is also referred to as an absolute path."

i don't know if you should also consider /

It's common for applications ported to windows to consider both \ and / (e.g. neovim). Maybe it would be a nice idea if EFL accepted both as well? At least in Windows.

we do almost nothing about that. Usually, when one passes a path to a Windows file API, the API changes all the slashes to backslashes

Hm, so you mean that in EFL's point of view, it doesn't matter if the path is with \\ or /, the only one who would and should care is the underlying OS API (which will then report if the path is or not valid)?

yes

vtorri accepted this revision.Jun 30 2020, 12:09 PM

i've applied it and unit tests are successful, so ok for it

This revision is now accepted and ready to land.Jun 30 2020, 12:09 PM
jptiz accepted this revision.Jun 30 2020, 12:29 PM
stefan_schmidt accepted this revision.Jul 6 2020, 1:49 AM
This revision was automatically updated to reflect the committed changes.