Commit 73c4e5130953c36101fa0f5a24a8100ae62340ac
1 parent
fc337b91
Exists in
master
and in
1 other branch
Fixing remap file path on windows.
Showing
1 changed file
with
27 additions
and
1 deletions
Show diff stats
src/terminal/charset.c
| ... | ... | @@ -33,6 +33,10 @@ |
| 33 | 33 | #include <lib3270/log.h> |
| 34 | 34 | #include <v3270/dialogs.h> |
| 35 | 35 | |
| 36 | +#ifdef _WIN32 | |
| 37 | + #include <lmcons.h> | |
| 38 | +#endif // _WIN32 | |
| 39 | + | |
| 36 | 40 | #define ERROR_DOMAIN g_quark_from_static_string(PACKAGE_NAME) |
| 37 | 41 | |
| 38 | 42 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| ... | ... | @@ -187,7 +191,29 @@ |
| 187 | 191 | const gchar * const * system_data_dirs = g_get_system_data_dirs(); |
| 188 | 192 | |
| 189 | 193 | #ifdef _WIN32 |
| 190 | - #error Implementar. | |
| 194 | + { | |
| 195 | + char wc_fn[MAX_PATH]; | |
| 196 | + | |
| 197 | + if(GetModuleFileName(NULL, wc_fn, MAX_PATH)) | |
| 198 | + { | |
| 199 | + char *p; | |
| 200 | + | |
| 201 | + if((p = strrchr(wc_fn, '\\')) != NULL) | |
| 202 | + *p = '\0'; | |
| 203 | + | |
| 204 | + if((p = strrchr(wc_fn, '/')) != NULL) | |
| 205 | + *p = '\0'; | |
| 206 | + | |
| 207 | + gchar *filename = g_build_filename(wc_fn,G_STRINGIFY(PRODUCT_NAME),"remap",name,NULL); | |
| 208 | + | |
| 209 | + debug("%s.win32=%s",__FUNCTION__,filename); | |
| 210 | + if(g_file_test(filename,G_FILE_TEST_IS_REGULAR)) | |
| 211 | + return filename; | |
| 212 | + | |
| 213 | + g_free(filename); | |
| 214 | + } | |
| 215 | + | |
| 216 | + } | |
| 191 | 217 | #endif // _WIN32 |
| 192 | 218 | |
| 193 | 219 | for(ix=0;system_data_dirs[ix];ix++) | ... | ... |