Sanitize replacement of CLI args
ClosedPublic

Authored by elvisangelaccio on Mar 21 2016, 11:06 AM.

Details

Summary

The code where the CLI args placeholders are substituted (in CliInterface::copyFiles()) is a nightmare and works only by chance. The cliunarchiver plugin exposed a bug in (at least) the replacement of PasswordSwitch.

The only way to fix it is to trash the old algorithm and rewrite it from scratch. We don't do anymore black magic with the indexes, to edit the args list. We just create a new empty list and we append stuff to it.

New functions are introduced to simplify the for loop.

Test Plan

Autotests still pass, but this is a core piece of the codebase, so let's make sure that nothing breaks... :)

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
elvisangelaccio retitled this revision from to Sanitize replacement of CLI args.
elvisangelaccio updated this object.
elvisangelaccio edited the test plan for this revision. (Show Details)
elvisangelaccio added a reviewer: rthomsen.
elvisangelaccio set the repository for this revision to R36 Ark.
elvisangelaccio added a project: Ark.
elvisangelaccio updated this object.
elvisangelaccio added a subscriber: kde-utils-devel.

Added unit test for clirar args replacement.

Rebased patch on top of Applications/16.04 branch

Forget tests during rebase :)

Fixed bug when checking the password protected hint.

Fix another bug with unzip+wrong passwords.

rthomsen accepted this revision.Mar 22 2016, 5:21 PM
rthomsen edited edge metadata.

Ship it! Thanks for cleaning up this ancient mess :)

This revision is now accepted and ready to land.Mar 22 2016, 5:21 PM