History

undo test commenting out code with preprocessor directives

Jack Atherton committed 7 years ago

Commit b91dd1e1 parent db1a1dd26 files · +7454 −7195Browse files

Showing the changes to src/core/util_string.cpp (1 of 26 files). Show all

Unified · Split

src/core/util_string.cpp+25−24
@@ -361,34 +361,35 @@ done: · 360 unmodified lines
361 361
362/* from http://developer.apple.com/library/mac/#qa/qa1549/_index.html */362/* from http://developer.apple.com/library/mac/#qa/qa1549/_index.html */
363 363
364#ifndef __PLATFORM_WIN32__364#if !defined(__PLATFORM_WIN32__) && !defined(__EMSCRIPTEN__)
365 365
366#include <glob.h>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//}
390 368
391#endif // __PLATFORM_WIN32__369char* CreatePathByExpandingTildePath(const char* path)
370{
371 glob_t globbuf;
372 char **v;
373 char *expandedPath = NULL, *result = NULL;
374
375 assert(path != NULL);
376
377 if (glob(path, GLOB_TILDE, NULL, &globbuf) == 0) //success
378 {
379 v = globbuf.gl_pathv; //list of matched pathnames
380 expandedPath = v[0]; //number of matched pathnames, gl_pathc == 1
381
382 result = (char*)calloc(1, strlen(expandedPath) + 1); //the extra char is for the null-termination
383 if(result)
384 strncpy(result, expandedPath, strlen(expandedPath) + 1); //copy the null-termination as well
385
386 globfree(&globbuf);
387 }
388
389 return result;
390}
391
392#endif // __PLATFORM_WIN32__ && __EMSCRIPTEN__
392 393
393 394
394// get full path to file395// get full path to file

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t