diff options
author | Benoit Daloze <eregontp@gmail.com> | 2023-08-02 17:08:19 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2023-08-02 17:13:38 +0200 |
commit | 3c41a04b6cedbace1406d46a20a673f59b1502de (patch) | |
tree | cc48ba17ca43145456f13421267f3d5a0c0bb51f /ruby.c | |
parent | a502cd80a592c90dc76daf06687ce67bdb183d02 (diff) |
Fix encoding switches when RUBYOPT is empty or only spaces
* Follow-up of dbbc3583ba432c279f07b1fa0afb0a8a9ba50c91 which broke this.
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -895,10 +895,11 @@ moreswitches(const char *s, ruby_cmdline_options_t *opt, int envopt) ruby_features_t warn = opt->warn; int backtrace_length_limit = opt->backtrace_length_limit; - opt->src.enc.name = opt->ext.enc.name = opt->intern.enc.name = 0; - while (ISSPACE(*s)) s++; if (!*s) return; + + opt->src.enc.name = opt->ext.enc.name = opt->intern.enc.name = 0; + argstr = rb_str_tmp_new((len = strlen(s)) + (envopt!=0)); argary = rb_str_tmp_new(0); |