deliver the real cp also if a constant is passed

This commit is contained in:
Anatol Belski 2016-12-20 02:40:44 +01:00
parent 6ea44908fb
commit 21e2836473

View file

@ -266,6 +266,17 @@ PW32CP const struct php_win32_cp *php_win32_cp_get_by_id(DWORD id)
{/*{{{*/ {/*{{{*/
size_t i; size_t i;
if (id < php_win32_cp_map[0].id) {
switch (id) {
case CP_ACP:
id = GetACP();
break;
case CP_OEMCP:
id = GetOEMCP();
break;
}
}
for (i = 0; i < sizeof(php_win32_cp_map)/sizeof(struct php_win32_cp); i++) { for (i = 0; i < sizeof(php_win32_cp_map)/sizeof(struct php_win32_cp); i++) {
if (php_win32_cp_map[i].id == id) { if (php_win32_cp_map[i].id == id) {
return &php_win32_cp_map[i]; return &php_win32_cp_map[i];