Skip to content

Commit

Permalink
Use strcasecmp
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jun 21, 2024
1 parent 3798aae commit f8ec8a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ext/io/console/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,9 @@ console_scroll(VALUE io, int line)
return io;
}

#define GPERF_DOWNCASE 1
#define GPERF_CASE_STRCMP 1
#define gperf_case_strcmp strcasecmp
#include "win32_vk.inc"

/*
Expand Down
2 changes: 1 addition & 1 deletion ext/io/console/win32_vk.inc
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ struct vktable;

#ifndef GPERF_DOWNCASE
#define GPERF_DOWNCASE 1
static const unsigned char gperf_downcase[256] =
static unsigned char gperf_downcase[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
Expand Down
1 change: 0 additions & 1 deletion tool/gperf.sed
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
s/ hval = / hval = (unsigned int)/
s/ return / return (unsigned int)/
}
s/^\(static\) \(unsigned char gperf_downcase\)/\1 const \2/

0 comments on commit f8ec8a0

Please sign in to comment.