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
361361
362362 /* from http://developer.apple.com/library/mac/#qa/qa1549/_index.html */
363363
364−#ifndef __PLATFORM_WIN32__
364+#if !defined(__PLATFORM_WIN32__) && !defined(__EMSCRIPTEN__)
365365
366366 #include <glob.h>
367367
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−//}
390368
391−#endif // __PLATFORM_WIN32__
369+char* 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__
392393
393394
394395 // 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