summaryrefslogtreecommitdiff
path: root/ruby.h
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-08 06:43:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-08 06:43:14 +0000
commitdc98adf839d0d68c4c18647a1db2fb3dc9be8cc4 (patch)
tree7f6e3c4b45359409bf57526308837f5dbbc45905 /ruby.h
parentab827130d3f563535abb7404230f5b5e63bf0946 (diff)
* process.c (security): always give warning for insecure PATH.
* dir.c (my_getcwd): do not rely on MAXPATHLEN. * file.c (rb_file_s_readlink): ditto. * file.c (path_check_1): ditto. * eval.c (rb_yield_0): should not call rb_f_block_given_p(). * string.c (rb_str_chomp_bang): should terminate string by NUL. * eval.c (rb_yield_0): better error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.h')
-rw-r--r--ruby.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/ruby.h b/ruby.h
index 3f6742d..65b4d3b 100644
--- a/ruby.h
+++ b/ruby.h
@@ -35,15 +35,16 @@ extern "C" {
#include <stdio.h>
/* need to include <ctype.h> to use these macros */
+#define ISASCII(c) isascii((unsigned char)(c))
#undef ISPRINT
-#define ISPRINT(c) isprint((unsigned char)(c))
-#define ISSPACE(c) isspace((unsigned char)(c))
-#define ISUPPER(c) isupper((unsigned char)(c))
-#define ISLOWER(c) islower((unsigned char)(c))
-#define ISALNUM(c) isalnum((unsigned char)(c))
-#define ISALPHA(c) isalpha((unsigned char)(c))
-#define ISDIGIT(c) isdigit((unsigned char)(c))
-#define ISXDIGIT(c) isxdigit((unsigned char)(c))
+#define ISPRINT(c) (ISASCII(c) && isprint((unsigned char)(c)))
+#define ISSPACE(c) (ISASCII(c) && isspace((unsigned char)(c)))
+#define ISUPPER(c) (ISASCII(c) && isupper((unsigned char)(c)))
+#define ISLOWER(c) (ISASCII(c) && islower((unsigned char)(c)))
+#define ISALNUM(c) (ISASCII(c) && isalnum((unsigned char)(c)))
+#define ISALPHA(c) (ISASCII(c) && isalpha((unsigned char)(c)))
+#define ISDIGIT(c) (ISASCII(c) && isdigit((unsigned char)(c)))
+#define ISXDIGIT(c) (ISASCII(c) && isxdigit((unsigned char)(c)))
#if !defined(__STDC__) && !defined(_MSC_VER)
# define volatile