candera / shadowspawn

A Windows utility that mounts a shadow copy of the disk at a drive letter and then spawns an arbitrary command.
MIT License
184 stars 55 forks source link

Options starting with - are incorrectly interpreted #14

Closed candera closed 12 years ago

candera commented 12 years ago

A user on the mailing list (here) reports the following:

Hi,

 While attempting to use ShadowSpawn with Rsync, I discovered a bug
in the parsing of
 arguments to .

 Viz., Arguments beginning with '-' are interpreted as arguments to
ShadowSpawn itself,
 rather than arguments to . ShadowSpawn then fails the
operation, complaining
 about an unknown argument.

 This can be fixed in COptions.h, as follows:

-if (options._command.empty() && Utilities::StartsWith(arg, TEXT("/"))
|| Utilities::StartsWith(arg, TEXT("-")))

+if (options._command.empty() && (Utilities::StartsWith(arg,
TEXT("/")) || Utilities::StartsWith(arg, TEXT("-"))))

 ShadowSpawn can then be successfully used with Rsync.

Note that a patch is included.