Allow some more characters (up to 64 char) in UDL name

Fix #5400, fix #4714, close #5458
This commit is contained in:
Rajendra Singh 2019-03-26 21:37:24 +05:30 committed by Don HO
parent cfa702a8a8
commit cf35168491
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
2 changed files with 5 additions and 4 deletions

View File

@ -2086,18 +2086,19 @@ void Notepad_plus::checkLangsMenu(int id) const
if (curBuf->isUserDefineLangExt()) if (curBuf->isUserDefineLangExt())
{ {
const TCHAR *userLangName = curBuf->getUserDefineLangName(); const TCHAR *userLangName = curBuf->getUserDefineLangName();
const int nbChar = 16; TCHAR menuLangName[langNameLenMax];
TCHAR menuLangName[nbChar];
for (int i = IDM_LANG_USER + 1 ; i <= IDM_LANG_USER_LIMIT ; ++i) for (int i = IDM_LANG_USER + 1 ; i <= IDM_LANG_USER_LIMIT ; ++i)
{ {
if (::GetMenuString(_mainMenuHandle, i, menuLangName, nbChar-1, MF_BYCOMMAND)) if (::GetMenuString(_mainMenuHandle, i, menuLangName, langNameLenMax, MF_BYCOMMAND))
{
if (!lstrcmp(userLangName, menuLangName)) if (!lstrcmp(userLangName, menuLangName))
{ {
HMENU _langMenuHandle = ::GetSubMenu(_mainMenuHandle, MENUINDEX_LANGUAGE); HMENU _langMenuHandle = ::GetSubMenu(_mainMenuHandle, MENUINDEX_LANGUAGE);
doCheck(_langMenuHandle, i); doCheck(_langMenuHandle, i);
return; return;
} }
}
} }
} }
} }

View File

@ -31,7 +31,7 @@
#include "SciLexer.h" #include "SciLexer.h"
const int langNameLenMax = 33; const int langNameLenMax = 64;
const int extsLenMax = 256; const int extsLenMax = 256;
const int max_char = 1024*30; const int max_char = 1024*30;