@@ -466,8 +466,8 @@ static char *abspath(const char *in, int nprefix)
466466 memcpy (out , in , sz + nprefix );
467467 }
468468 else {
469- size_t path_size = PATH_MAX ;
470- char * path = (char * )malloc_s (PATH_MAX );
469+ size_t path_size = JL_PATH_MAX ;
470+ char * path = (char * )malloc_s (JL_PATH_MAX );
471471 if (uv_cwd (path , & path_size )) {
472472 jl_error ("fatal error: unexpected error while retrieving current working directory" );
473473 }
@@ -502,8 +502,8 @@ static const char *absformat(const char *in)
502502 if (in [0 ] == '%' || jl_isabspath (in ))
503503 return in ;
504504 // get an escaped copy of cwd
505- size_t path_size = PATH_MAX ;
506- char path [PATH_MAX ];
505+ size_t path_size = JL_PATH_MAX ;
506+ char path [JL_PATH_MAX ];
507507 if (uv_cwd (path , & path_size )) {
508508 jl_error ("fatal error: unexpected error while retrieving current working directory" );
509509 }
@@ -527,17 +527,17 @@ static const char *absformat(const char *in)
527527static void jl_resolve_sysimg_location (JL_IMAGE_SEARCH rel )
528528{ // this function resolves the paths in jl_options to absolute file locations as needed
529529 // and it replaces the pointers to `julia_bindir`, `julia_bin`, `image_file`, and output file paths
530- // it may fail, print an error, and exit(1) if any of these paths are longer than PATH_MAX
530+ // it may fail, print an error, and exit(1) if any of these paths are longer than JL_PATH_MAX
531531 //
532532 // note: if you care about lost memory, you should call the appropriate `free()` function
533533 // on the original pointer for each `char*` you've inserted into `jl_options`, after
534534 // calling `julia_init()`
535- char * free_path = (char * )malloc_s (PATH_MAX );
536- size_t path_size = PATH_MAX ;
535+ char * free_path = (char * )malloc_s (JL_PATH_MAX );
536+ size_t path_size = JL_PATH_MAX ;
537537 if (uv_exepath (free_path , & path_size )) {
538538 jl_error ("fatal error: unexpected error while retrieving exepath" );
539539 }
540- if (path_size >= PATH_MAX ) {
540+ if (path_size >= JL_PATH_MAX ) {
541541 jl_error ("fatal error: jl_options.julia_bin path too long" );
542542 }
543543 jl_options .julia_bin = (char * )malloc_s (path_size + 1 );
@@ -556,10 +556,10 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel)
556556 if (jl_options .image_file ) {
557557 if (rel == JL_IMAGE_JULIA_HOME && !jl_isabspath (jl_options .image_file )) {
558558 // build time path, relative to JULIA_BINDIR
559- free_path = (char * )malloc_s (PATH_MAX );
560- int n = snprintf (free_path , PATH_MAX , "%s" PATHSEPSTRING "%s" ,
559+ free_path = (char * )malloc_s (JL_PATH_MAX );
560+ int n = snprintf (free_path , JL_PATH_MAX , "%s" PATHSEPSTRING "%s" ,
561561 jl_options .julia_bindir , jl_options .image_file );
562- if (n >= PATH_MAX || n < 0 ) {
562+ if (n >= JL_PATH_MAX || n < 0 ) {
563563 jl_error ("fatal error: jl_options.image_file path too long" );
564564 }
565565 jl_options .image_file = free_path ;
0 commit comments