Page 1 of 1
<selitem> and "\"
Posted: 25 Jan 2018 15:23
by Filehero
Hi,
is there a tweak I've missed?
Why does <selitem> returns the tailing "\" for drives (the root folder) but not for child folders? It's the same with Files > To Clipboard > Item Path/Names.
The behavior should be the same, shouldn't it?
Re: <selitem> and "\"
Posted: 25 Jan 2018 16:01
by jupe
I think this could possibly be because of:
slashed.png
screenshot taken of the XYplorer help file.
Re: <selitem> and "\"
Posted: 25 Jan 2018 16:42
by Filehero
Hi Jupe,
thanks for the possible explanation. Another legacy Windows awkwardness, it seems.
Re: <selitem> and "\"
Posted: 26 Jan 2018 10:57
by admin
Filehero wrote:Hi Jupe,
thanks for the possible explanation. Another legacy Windows awkwardness, it seems.
OK, but shouldn't XYplorer variables return something that has some consistency? I think all paths should be returned
unslashed.
And, if you are in C: this returns "C:" unslashed:
But if I'd change it now, would I break old code? Probably...

Re: <selitem> and "\"
Posted: 26 Jan 2018 15:10
by Filehero
admin wrote:
OK, but shouldn't XYplorer variables return something that has some consistency? I think all paths should be returned unslashed.
Yes, hence my question.
admin wrote:
But if I'd change it now, would I break old code? Probably...

Unfortunately, yes. Perhaps a tweak?
Re: <selitem> and "\"
Posted: 26 Jan 2018 16:59
by admin
Given that usually xy variables and environment variables return paths without a trailing slash, and I know for sure that this is intended and coded in many places in the program, I would classify this as a bug, which means I should just fix it.
Any objections?
Re: <selitem> and "\"
Posted: 26 Jan 2018 17:35
by highend
But this change will break scripts as well...
And if you really do it, don't forget that some shell context menus do the same:
To Clipboard - Item Path(s) comes to my mind...
Re: <selitem> and "\"
Posted: 26 Jan 2018 18:57
by admin
Damn, you are right.