-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[urar helper] fix filenames with spaces handling with unrar v5 #3073
Comments
|
|
I think this is not so good solution.
|
Replying to Hamer13:
Agree.
Why 65? |
Replying to andrew_b:
Ah, sorry... No question.
I'm not sure that width of 'Size' and 'Packet' fields is constant always. Can it be wider for huge files? |
Branch: 3073_urar5_spaces |
It's not portable. seps a) is a gawk extension and b) gawk >= 4.0.0. is required. |
*ARGH* *darn* Too good to be portable ... Thanks a bundle andrew_b. Didn't
I still dislike indexing by the CRC field though, just on general principle.
I'll ponder programming around that and submit if I come up with anything
PS: I'm one of the maintainers of the mc package for openSUSE |
Dnh, we have to maintain lot of the things related to backward compatibility (such as: support of OpenWrt-distros, BusyBox-toolset and so on). Would be great to find a way to split few first parameters and to stay 'filename' parameter 'as is' with spaces. Your patch looks pretty good, but as Andrew say, your way will have restricted use cases.
Probably, we should check a version of gawk in configure.ac script and next we may set up some flag to switch between algorithms in the VFS-helper... |
Once you think about the change it was easy to replace the four-arg split. The only problem was getting the seps[i+1] right. |
I've attached the test archive with the following content
<spase> above is the mark of space in the file name.
This patch has some trouble with "testfile3 " file (name is finished with space). Trailing space is lost. Other names are processed correctly. |
Yes, some oSuSE user (not sure if he wants to be mentioned here) already
I'll update the attached patch. My solution is to add a 'name=name seps[i]'
This still get's torpedoed for names less than 13 chars length by the
+ ### remove padding blanks from short names
from the patch.
BTW: shouldn't we gather some "testing" .rar (and other archive) files in the
Sorry this got so long ... |
fix to add trailing seps[*] stuff |
Indeed, in output if unrar v or unrar l there are padding spaces after file name.
They cannot be removed correctly. If file name finished with space(s) we get corrupted file name at the output.
But output of unrar vt contains correct file names w/o any padding:
I think, we can try to parse this output. We need only following three lines:
|
Replying to andrew_b:
Exactly. And short filenames with trailing spaces are probably more seldom than
Got a seemingly working first draft already. At least working with "my" test archive containing cases mentionend in this ticket. Even though I wrote it pretty tired I'll attach the new patch for you all to test on whatever "weird" archives you have and for portability issues. |
Reimplementation of mcrar5fs_list in vfs/extfs/helpers/urar using 'unrar vt' |
Great!
Branch: 3073_urar5_spaces (rebased) |
|
|
*argh* missed a '' in a regex ... Should not be critical, but please add ... |
|
Simplest solution for this error (just print the rest of rar output without interpreting filenames by awk):
Testes with mc v4.8.10 and rar v5.01. |
Replying to slodki:
The problem is, that 'unrar [vl]' is padding short filenames with spaces at the end! So 'unrar vt' is used as of 4.8.11, see the changeset above in this ticket and the rest of this ticket. |
Important
This issue was migrated from Trac:
post-factum
(@pfactum)dnh@….org
urar
,unrar
unrar v5 helper script doesn't print filenames with spaces. The following pull request fixes that.
#28
Note
Original attachments:
andrew_b
(@aborodin) onNov 25, 2013 at 9:26 UTC
dnh
(dnh@….org) onNov 25, 2013 at 22:04 UTC
dnh
(dnh@….org) onNov 27, 2013 at 0:59 UTC
dnh
(dnh@….org) onDec 12, 2013 at 14:56 UTC
The text was updated successfully, but these errors were encountered: