Ilya Shpigor shpigor@etersoft.ru writes:
That parsing approach is not really appropriate here, the options are not just a bunch of flags, there are options with arguments, mutually exclusive modes, etc. Some sort of switch() statement would be more natural.
Alexandre Julliard wrote:
Actually they are just a bunch of flags with exception for /L which takes an argument - this is covered by Ilya's third patch, and /C, /D and /E which are mutually exclusive "mode" switches - this is covered by CMD_FLAGS bitmask. At least Vista's extrac32 don't care for inappropriate flags, e.g.:
Microsoft (R) Cabinet Extraction Tool - Version 6.0.6001.18000 Copyright (c) Microsoft Corporation. All rights reserved.. Extracting test -> temp\test
And indeed there is a copied file in "temp" directory despite erroneous "/A" and "/L path" flags.