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 | 366 | #include <glob.h> |
| 367 | 367 | |
| 368 | −char* CreatePathByExpandingTildePath(const char* path) | |
| 369 | −{ | |
| 370 | − glob_t globbuf; | |
| 371 | − char **v; | |
| 372 | − char *expandedPath = NULL, *result = NULL; | |
| 373 | − | |
| 374 | − assert(path != NULL); | |
| 375 | − | |
| 376 | − if (glob(path, GLOB_TILDE, NULL, &globbuf) == 0) //success | |
| 377 | − { | |
| 378 | − v = globbuf.gl_pathv; //list of matched pathnames | |
| 379 | − expandedPath = v[0]; //number of matched pathnames, gl_pathc == 1 | |
| 380 | − | |
| 381 | − result = (char*)calloc(1, strlen(expandedPath) + 1); //the extra char is for the null-termination | |
| 382 | − if(result) | |
| 383 | − strncpy(result, expandedPath, strlen(expandedPath) + 1); //copy the null-termination as well | |
| 384 | − | |
| 385 | − globfree(&globbuf); | |
| 386 | − } | |
| 387 | − | |
| 388 | − return result; | |
| 389 | −} | |
| 368 | +//char* CreatePathByExpandingTildePath(const char* path) | |
| 369 | +//{ | |
| 370 | +// glob_t globbuf; | |
| 371 | +// char **v; | |
| 372 | +// char *expandedPath = NULL, *result = NULL; | |
| 373 | +// | |
| 374 | +// assert(path != NULL); | |
| 375 | +// | |
| 376 | +// if (glob(path, GLOB_TILDE, NULL, &globbuf) == 0) //success | |
| 377 | +// { | |
| 378 | +// v = globbuf.gl_pathv; //list of matched pathnames | |
| 379 | +// expandedPath = v[0]; //number of matched pathnames, gl_pathc == 1 | |
| 380 | +// | |
| 381 | +// result = (char*)calloc(1, strlen(expandedPath) + 1); //the extra char is for the null-termination | |
| 382 | +// if(result) | |
| 383 | +// strncpy(result, expandedPath, strlen(expandedPath) + 1); //copy the null-termination as well | |
| 384 | +// | |
| 385 | +// globfree(&globbuf); | |
| 386 | +// } | |
| 387 | +// | |
| 388 | +// return result; | |
| 389 | +//} | |
| 390 | 390 | |
| 391 | 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 | 431 | std::string expand_filepath( std::string & fp ) |
| 432 | 432 | { |
| 433 | −#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) | |
| 434 | − // no expansion in Windows systems | |
| 433 | +#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__EMSCRIPTEN__) | |
| 434 | + // no expansion in Windows systems or Emscripten | |
| 435 | 435 | return fp; |
| 436 | 436 | #else |
| 437 | 437 | |