The current parser code in clirarplugin's cliplugin.cpp is a big mess: we need to handle RAR v4, RAR v5 and unrar-free and they all have different output formats. Having just a big switch to handle the parser's state made sense when we only supported RAR v3 and v4 (which had the same output format), but now a method that's ~230-lines long and is hard to follow. We could first identify the RAR version we're dealing with and instantiate a different parser based on that.
Agreed, and sorry for the mess :)
Git commit e13da507c72490a7c5a594d646f040e812fa9d15 by Raphael Kubo da Costa. Committed on 12/02/2014 at 22:46. Pushed by rkcosta into branch 'KDE/4.12'. rar: Do not crash when unrar lists a symlink. RAR v3 and v4 output an extra line when an entry is a symlink. This line contains the symlink target. Since we were not accounting for this extra line before, our parser crashed. Work around the issue by checking if we're listing a symlink and skipping an extra line if so. FIXED-IN: 4.12.3 M +17 -1 plugins/clirarplugin/cliplugin.cpp M +1 -0 plugins/clirarplugin/cliplugin.h M +25 -1 plugins/clirarplugin/tests/clirartest.cpp M +1 -0 plugins/clirarplugin/tests/clirartest.h A +22 -0 plugins/clirarplugin/tests/data/testReadArchiveWithSymlink.txt http://commits.kde.org/ark/e13da507c72490a7c5a594d646f040e812fa9d15
Crap, I shouldn't keep multiple Bugzilla tabs open at the same time :-) This commit was supposed to refer to bug 314297.
Created attachment 85536 [details] May be solved bug 331065.
ck Lux's patch is being tracked at https://git.reviewboard.kde.org/r/116721/
Git commit b738a0041a44ad9c36644aa903c6621ac9e265e9 by Ragnar Thomsen. Committed on 13/09/2015 at 16:45. Pushed by rthomsen into branch 'master'. clirar: Rewrite unrar parsing code readListLine() is now very short. It simply checks the version of unrar and calls line-handling functions specific for unrar 3/4 and 5 termed handleUnrar4Line() and handleUnrar5Line(), respectively. When the line-handling functions have completed parsing all the details of an archive entry, they call an entry-handling function, either handleUnrar4Entry() or handleUnrar5Entry(). FIXED-IN: 15.12.0 REVIEW: 124503 M +329 -191 plugins/clirarplugin/cliplugin.cpp M +19 -9 plugins/clirarplugin/cliplugin.h http://commits.kde.org/ark/b738a0041a44ad9c36644aa903c6621ac9e265e9