зеркало из https://github.com/github/ruby.git
* configure.in (rb_cv_broken_crypt): needs more checks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5703c1756c
Коммит
df9f513387
|
@ -1,3 +1,7 @@
|
|||
Wed Aug 12 11:51:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (rb_cv_broken_crypt): needs more checks.
|
||||
|
||||
Wed Aug 12 08:39:15 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* sprintf.c (rb_str_format): should preserve format encoding
|
||||
|
|
19
configure.in
19
configure.in
|
@ -769,12 +769,25 @@ when(darwin*) RUBY_PREPEND_OPTION(LIBS, -lobjc)
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
char buf[256];
|
||||
strcpy(buf, crypt("", "\xE0\xA0"));
|
||||
return strcmp(buf, crypt("", "\xE0\xA0"));
|
||||
int i;
|
||||
for (i = 0; i < 128*128; i++) {
|
||||
char salt[2], buf[256], *s;
|
||||
salt[0] = 0x80 | (i & 0x7f);
|
||||
salt[1] = 0x80 | (i >> 7);
|
||||
strcpy(buf, crypt("", salt));
|
||||
if (strcmp(buf, s = crypt("", salt))) {
|
||||
#if 0
|
||||
printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
|
||||
buf+2, s+2);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
rb_cv_broken_crypt=no,
|
||||
|
|
Загрузка…
Ссылка в новой задаче