File tree Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change 44
55#include <stdlib.h>
66
7- #if defined(MAXPATH )
8- #define FF_EXE_PATH_LEN MAXPATH
9- #elif defined(PATH_MAX )
10- #define FF_EXE_PATH_LEN PATH_MAX
11- #else
12- #define FF_EXE_PATH_LEN 260
13- #endif
14-
15- #ifdef _WIN32
16- static inline char * realpath (const char * restrict file_name , char * restrict resolved_name )
17- {
18- char * result = _fullpath (resolved_name , file_name , _MAX_PATH );
19- if (result )
20- {
21- resolved_name [1 ] = resolved_name [0 ]; // Drive Name
22- resolved_name [0 ] = '/' ;
23- }
24- return result ;
25- }
26- #endif
27-
287const char * ffDetectEditor (FFEditorResult * result )
298{
309 ffStrbufSetS (& result -> name , getenv ("VISUAL" ));
@@ -46,7 +25,7 @@ const char* ffDetectEditor(FFEditorResult* result)
4625 else
4726 ffStrbufSet (& result -> path , & result -> name );
4827
49- char buf [FF_EXE_PATH_LEN ];
28+ char buf [PATH_MAX + 1 ];
5029 if (!realpath (result -> path .chars , buf ))
5130 return NULL ;
5231
You can’t perform that action at this time.
0 commit comments