! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
When in icon/list view type ~/ the wrong completion list is shown
Status:
RESOLVED: FIXED

Comments

Description Peter de Ridder editbugs 2007-03-04 21:07:30 CET
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061219 Iceape/1.0.7 (Debian-1.0.7-3)
Build Identifier: 

When in the icon/list view of the thunar browser the ~/ ,this will give you either the location-dialog or bring you to the location-tool-bar, the wrong completion list is shown.
when another character is typed the completion list is corrected.

Reproducible: Always

Steps to Reproduce:
1. start thunar
2. the icon/list view or location-tool-bar should have focus
3. type ~/

Actual Results:  
the completion list of /home/ is shown

Expected Results:  
the completion list of /home/me/ should be shown
Comment 1 Peter de Ridder editbugs 2007-03-17 10:54:03 CET
Created attachment 1038 
Patch for ~/

I'm not sure if this is the right solution,
In thunar_vfs_expand_filename is the ~ replaced bij the home dir.
Only when the filename is ~/ the trailing / was forgotten, so the ~/ is expanded to home/dir not home/dir/
This gave the wrong competion list in the thunar-location-entry
Comment 2 Jérôme Guelfucci editbugs 2007-08-10 23:10:59 CEST
This seems to be fixed in thunar 0.8.0.
Comment 3 Peter de Ridder editbugs 2007-09-01 17:28:42 CEST
(In reply to comment #2)
> This seems to be fixed in thunar 0.8.0.
> 

This still doesn't work correctly in the svn trunk.
the wrong completion list is only shown if ~ isn't expanded to /home/user.
When the current directory is the home directory ~ is always expanded, so the correct list is shown.
when the current directory is xhanged ~ doesn't always expand, if it isn't expanded the wrong list is shown.

A other solution to this problem is to always make ~ expand to /home/user.
I tried to do this but i didn't succeed.
Comment 4 Jannis Pohlmann editbugs 2008-11-25 02:12:29 CET
The problem is not in thunar-vfs IMHO. It's rather that thunar_path_entry_parse() which splits up the path into folder and file part expands "~" to "/home/username" using thunar-vfs (everything's fine until here) and then assumes that "username" is actually a file so it uses "/home" for the folder part. And of course this is wrong.

We'll look into it.
Comment 5 Nick Schermer editbugs 2008-11-25 19:05:46 CET
Debugged this and the patch peter provided was the correct place to fix this.

Steps in thunar_vfs_expand_filename:
- thunar_vfs_expand_filename ("~/")
- Start with a ~
- Remainder is "~/" + 1, so that makes remainder "/"
- Now we lookup the first slash, this is the first char, so
  nothing actually happens here. 
- slash == remainder, so the replacement becomes "/home/nick"
- Now we build the filename which is replacement, slash + 1.

So the last step is wrong, because slash + 1 == '\0' in this case and "/home/nick" is returned.

Also debugged the ~username/ case, seems to work fine too.

Fixed in revision 28908.

Bug #2973

Reported by:
Peter de Ridder
Reported on: 2007-03-04
Last modified on: 2009-07-17

People

Assignee:
Jannis Pohlmann
CC List:
3 users

Version

Version:
unspecified

Attachments

Patch for ~/ (383 bytes, patch)
2007-03-17 10:54 CET , Peter de Ridder
no flags

Additional information