diff options
| author | Javier <dev.git@javispedro.com> | 2026-08-30 15:53:05 +0200 |
|---|---|---|
| committer | Javier <dev.git@javispedro.com> | 2026-08-30 15:53:05 +0200 |
| commit | 24bb6b6b4a40a7e7d9f430f9489626c93c58215d (patch) | |
| tree | 5eaa4b9fe90cdb8e44654169383acab431ad5059 /kitten.c | |
| parent | 9104ab9ab59c5b23e12a174368062b4bc166359f (diff) | |
| download | vbados-24bb6b6b4a40a7e7d9f430f9489626c93c58215d.tar.gz vbados-24bb6b6b4a40a7e7d9f430f9489626c93c58215d.zip | |
readd hack to kitten to load files from exe path, update vbmouse help message & nls files
Diffstat (limited to 'kitten.c')
| -rw-r--r-- | kitten.c | 37 |
1 files changed, 35 insertions, 2 deletions
@@ -164,6 +164,21 @@ const char *kittengets(int setnum, int msgnum, const char *message) /** + * Obtains path to current exec. + */ +static char * get_cmd_path(char *buf) +{ + char cmd_drive[_MAX_DRIVE]; + char cmd_dir[_MAX_DIR]; + + _splitpath(__argv[0], cmd_drive, cmd_dir, NULL, NULL); + _makepath(buf, cmd_drive, cmd_dir, "", NULL); + + return buf; +} + + +/** * Initialize kitten for program (name). */ @@ -220,8 +235,26 @@ nl_catd kittenopen(char *name) /* we copy the full LANG value or the part before "-" if "-" found */ catlang[2] = '\0'; - /* step through NLSPATH */ - + /* first try to find catalog file in the same path as exe */ + get_cmd_path(catfile); + strcat(catfile, name); + strcat(catfile, "."); + strcat(catfile, catlang); + _kitten_catalog = catread (catfile); + if (_kitten_catalog) + return (_kitten_catalog); + + /* maybe exe_path\nls\cat.%LANG% ? */ + get_cmd_path(catfile); + strcat(catfile, "NLS\\"); + strcat(catfile, name); + strcat(catfile, "."); + strcat(catfile, catlang); + _kitten_catalog = catread (catfile); + if (_kitten_catalog) + return (_kitten_catalog); + + /* otherwise step through NLSPATH */ nlsptr = getenv ("NLSPATH"); if (nlsptr == NULL) { |
