From 1d3bc61320a7628bc4e60c70880656867c22dc10 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 23 Jun 2003 08:41:07 +0000 Subject: * dir.c (find_dirsep): get rid of warnings. * eval.c (error_print): temporary value might be disposed by GC. * hash.c (env_has_value, env_index): should not increment NULL. * io.c (io_read, rb_io_sysread): not read when length is 0. * io.c (rb_io_reopen): ensure initialized IO. * io.c (rb_io_init_copy): sychronize file pointer. * io.c (rb_io_s_pipe): make exception proof. * string.c (rb_str_rindex_m): Fixnum 0 matched end of string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 8f636e159..b87d9e268 100644 --- a/hash.c +++ b/hash.c @@ -1583,8 +1583,8 @@ env_has_value(dmy, value) if (TYPE(value) != T_STRING) return Qfalse; env = GET_ENVIRON(environ); while (*env) { - char *s = strchr(*env, '=')+1; - if (s) { + char *s = strchr(*env, '='); + if (s++) { #ifdef ENV_IGNORECASE if (strncasecmp(s, RSTRING(value)->ptr, strlen(s)) == 0) { #else @@ -1610,8 +1610,8 @@ env_index(dmy, value) StringValue(value); env = GET_ENVIRON(environ); while (*env) { - char *s = strchr(*env, '=')+1; - if (s) { + char *s = strchr(*env, '='); + if (s++) { #ifdef ENV_IGNORECASE if (strncasecmp(s, RSTRING(value)->ptr, strlen(s)) == 0) { #else -- cgit