Showing the changes to src/core/util_string.cpp (1 of 23 files). Show all
Unified · Split
| @@ -365,28 +365,28 @@ done: · 364 unmodified lines | |||
| 365 | 365 | ||
| 366 | #include <glob.h> | 366 | #include <glob.h> |
| 367 | 367 | ||
| 368 | char* CreatePathByExpandingTildePath(const char* path) | 368 | //char* CreatePathByExpandingTildePath(const char* path) |
| 369 | { | 369 | //{ |
| 370 | glob_t globbuf; | 370 | // glob_t globbuf; |
| 371 | char **v; | 371 | // char **v; |
| 372 | char *expandedPath = NULL, *result = NULL; | 372 | // char *expandedPath = NULL, *result = NULL; |
| 373 | 373 | // | |
| 374 | assert(path != NULL); | 374 | // assert(path != NULL); |
| 375 | 375 | // | |
| 376 | if (glob(path, GLOB_TILDE, NULL, &globbuf) == 0) //success | 376 | // if (glob(path, GLOB_TILDE, NULL, &globbuf) == 0) //success |
| 377 | { | 377 | // { |
| 378 | v = globbuf.gl_pathv; //list of matched pathnames | 378 | // v = globbuf.gl_pathv; //list of matched pathnames |
| 379 | expandedPath = v[0]; //number of matched pathnames, gl_pathc == 1 | 379 | // expandedPath = v[0]; //number of matched pathnames, gl_pathc == 1 |
| 380 | 380 | // | |
| 381 | result = (char*)calloc(1, strlen(expandedPath) + 1); //the extra char is for the null-termination | 381 | // result = (char*)calloc(1, strlen(expandedPath) + 1); //the extra char is for the null-termination |
| 382 | if(result) | 382 | // if(result) |
| 383 | strncpy(result, expandedPath, strlen(expandedPath) + 1); //copy the null-termination as well | 383 | // strncpy(result, expandedPath, strlen(expandedPath) + 1); //copy the null-termination as well |
| 384 | 384 | // | |
| 385 | globfree(&globbuf); | 385 | // globfree(&globbuf); |
| 386 | } | 386 | // } |
| 387 | 387 | // | |
| 388 | return result; | 388 | // return result; |
| 389 | } | 389 | //} |
| 390 | 390 | ||
| 391 | #endif // __PLATFORM_WIN32__ | 391 | #endif // __PLATFORM_WIN32__ |
| 392 | 392 | ||
| @@ -430,8 +430,8 @@ std::string get_full_path( const std::string & fp ) · 37 unmodified lines | |||
| 430 | 430 | ||
| 431 | std::string expand_filepath( std::string & fp ) | 431 | std::string expand_filepath( std::string & fp ) |
| 432 | { | 432 | { |
| 433 | #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) | 433 | #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__EMSCRIPTEN__) |
| 434 | // no expansion in Windows systems | 434 | // no expansion in Windows systems or Emscripten |
| 435 | return fp; | 435 | return fp; |
| 436 | #else | 436 | #else |
| 437 | 437 | ||