Bug in parsing arguments to <command>

27 views
Skip to first unread message

yatsura2k

unread,
Nov 21, 2011, 4:56:21 AM11/21/11
to ShadowSpawn Support
Hi,

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

Viz., Arguments beginning with '-' are interpreted as arguments to
ShadowSpawn itself,
rather than arguments to <command>. 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.

Regards,
Yatsura.

Craig Andera

unread,
Nov 22, 2011, 10:06:12 AM11/22/11
to shadowsp...@googlegroups.com, yats...@gmail.com
Wow - a bug and a patch! You rock. Thanks for the contribution. I've
entered issue #14 [1], and I'd like to release an updated version at
some point that includes it. However, it will probably be at least
mid-December before I can make that happen.

Thanks again!

[1] https://github.com/candera/shadowspawn/issues/14

Reply all
Reply to author
Forward
0 new messages