diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-11-25 14:58:42 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-11-25 14:58:42 +0000 |
commit | b19934fbc3c981a7e4bb888f0d6a20f926a0bc17 (patch) | |
tree | e15476f7230d021c936b5765e76a19a2f90800f1 /perl.c | |
parent | a3179684398978e8bf4afba360eb728e4215d751 (diff) | |
download | perl-b19934fbc3c981a7e4bb888f0d6a20f926a0bc17.tar.gz |
Extend -d:foo=bar to make -d:-foo expand to C<no foo>, consistent with -M-foo
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -3048,11 +3048,21 @@ Perl_moreswitches(pTHX_ const char *s) /* The following permits -d:Mod to accepts arguments following an = in the fashion that -MSome::Mod does. */ if (*s == ':' || *s == '=') { - const char *start = ++s; - const char *const end = s + strlen(s); - SV * const sv = newSVpvs("use Devel::"); + const char *start; + const char *end; + SV *sv; + + if (*++s == '-') { + ++s; + sv = newSVpvs("no Devel::"); + } else { + sv = newSVpvs("use Devel::"); + } + + start = s; + end = s + strlen(s); - /* We now allow -d:Module=Foo,Bar */ + /* We now allow -d:Module=Foo,Bar and -d:-Module */ while(isALNUM(*s) || *s==':') ++s; if (*s != '=') sv_catpvn(sv, start, end - start); |