diff --git a/hash.c b/hash.c index 4321f479fd3e24..aee157266fc472 100644 --- a/hash.c +++ b/hash.c @@ -6487,7 +6487,7 @@ env_rassoc(VALUE dmy, VALUE obj) while (*env) { const char *p = *env; - char *s = strchr(p, '='); + const char *s = strchr(p, '='); if (s++) { long len = strlen(s); if (RSTRING_LEN(obj) == len && strncmp(s, RSTRING_PTR(obj), len) == 0) { @@ -6707,7 +6707,7 @@ env_shift(VALUE _) char **env = GET_ENVIRON(environ); if (*env) { const char *p = *env; - char *s = strchr(p, '='); + const char *s = strchr(p, '='); if (s) { key = env_str_new(p, s-p, enc); VALUE val = env_str_new2(getenv(RSTRING_PTR(key)), enc); diff --git a/load.c b/load.c index dc0302011605d9..f7bdf07641a84e 100644 --- a/load.c +++ b/load.c @@ -1712,7 +1712,7 @@ rb_ext_resolve_symbol(const char* fname, const char* symbol) VALUE handle; VALUE resolved; VALUE path; - char *ext; + const char *ext; VALUE fname_str = rb_str_new_cstr(fname); const rb_box_t *box = rb_loading_box(); diff --git a/ruby.c b/ruby.c index f9f50e99eac889..687d769285cbfb 100644 --- a/ruby.c +++ b/ruby.c @@ -1373,7 +1373,7 @@ proc_0_option(ruby_cmdline_options_t *opt, const char *s) static void proc_encoding_option(ruby_cmdline_options_t *opt, const char *s, const char *opt_name) { - char *p; + const char *p; # define set_encoding_part(type) \ if (!(p = strchr(s, ':'))) { \ set_##type##_encoding_once(opt, s, 0); \