GNOME Bugzilla – Bug 769309
dragging several files into / out from a folder with '&' in its name fails in some circumstances
Last modified: 2016-08-16 11:48:07 UTC
Maybe it's bad practice, but if filesystem allows, it can happen: you have a folder with an ampersand in its name. I can drag one file into / out from this folder without issues in every case I tested. But if you try to drag several files at once, either copy or move them, this works only sometimes. I have found it to fail (i.e. do nothing): i. when the destination folder is in the same level the files come from ii. when trying to put the files out of the folder, i.e. drag & drop to '..' Steps to reproduce: 1. create a folder named 'foo & bar' 2. in the same working directory, create some test files, say 'test1', 'test2', etc. 3. select all 'test*' files and try to drag & drop them into 'foo & bar' (will fail, either copy or move) 4. move them one by one into 'foo & bar' 5. cd to 'foo & bar' 6. select all 'test*' files and try to drag & drop them to '..' (will fail)
Thank you very much for taking the time to report this bug. Unfortunately I can not reproduce it with the current v1.4.8 on my system. I tried the given steps in /tmp as well as in my home directory. Nevertheless I believe that an '&' in the folder name can really lead to problems. Therefore, do me a favor and start gcmd in a terminal with the following command: "gnome-commander -d a" so that debug messages are printed to the terminal. After that, repeat the steps you described. Now watch out for some error messages in the terminal. It could be that we get a hint about what's happening inside gcmd when moving the files fails.
Created attachment 333041 [details] debugger output transcript
You are right: neither I can reproduce the issue with the steps listed! After some struggling, I could reproduce the problem at apparently random occurrences (this means I will not try to set a step-by-step list again) but in every occurrence, a dir *rename* with new name including an '&' was involved. AFAICS it has something to do with the dirlist cache. When the issue surfaces, I get this kind of messages from the debugger: (gnome-commander:4060): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as & I am attaching the debugger output from one session. This, I hope, will give you some hint. Also notice that maybe the copy/move is performed, just the dir listing is not updated.
I could identify the causes which lead to the warning messages and fixed the related problems. Now, the directory indicator is updated also for directories with '&' in the name - the problem was missing string escaping. This is now done also for the "delete dialog" which had the same problem. The fix will go into the next stable release of Gcmd. Nevertheless, the problem with not working copy/move of files could still not be reproduced here. If you have more info on how the reproduce it permanently, don't hesitate to open a new bug report.
Great. As suggested, maybe the copy/move was performed, just the dir listing was not updated. Can't say for sure for the original occurrence, but I remember there was a lot of folder renaming/moving involved. When trying to reproduce the issue, that seemed to be the case. Anyway will keep an eye on this. Thank you.