@@ -466,8 +466,8 @@ static char *abspath(const char *in, int nprefix)
466
466
memcpy (out , in , sz + nprefix );
467
467
}
468
468
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 );
471
471
if (uv_cwd (path , & path_size )) {
472
472
jl_error ("fatal error: unexpected error while retrieving current working directory" );
473
473
}
@@ -502,8 +502,8 @@ static const char *absformat(const char *in)
502
502
if (in [0 ] == '%' || jl_isabspath (in ))
503
503
return in ;
504
504
// 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 ];
507
507
if (uv_cwd (path , & path_size )) {
508
508
jl_error ("fatal error: unexpected error while retrieving current working directory" );
509
509
}
@@ -527,17 +527,17 @@ static const char *absformat(const char *in)
527
527
static void jl_resolve_sysimg_location (JL_IMAGE_SEARCH rel )
528
528
{ // this function resolves the paths in jl_options to absolute file locations as needed
529
529
// 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
531
531
//
532
532
// note: if you care about lost memory, you should call the appropriate `free()` function
533
533
// on the original pointer for each `char*` you've inserted into `jl_options`, after
534
534
// 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 ;
537
537
if (uv_exepath (free_path , & path_size )) {
538
538
jl_error ("fatal error: unexpected error while retrieving exepath" );
539
539
}
540
- if (path_size >= PATH_MAX ) {
540
+ if (path_size >= JL_PATH_MAX ) {
541
541
jl_error ("fatal error: jl_options.julia_bin path too long" );
542
542
}
543
543
jl_options .julia_bin = (char * )malloc_s (path_size + 1 );
@@ -556,10 +556,10 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel)
556
556
if (jl_options .image_file ) {
557
557
if (rel == JL_IMAGE_JULIA_HOME && !jl_isabspath (jl_options .image_file )) {
558
558
// 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" ,
561
561
jl_options .julia_bindir , jl_options .image_file );
562
- if (n >= PATH_MAX || n < 0 ) {
562
+ if (n >= JL_PATH_MAX || n < 0 ) {
563
563
jl_error ("fatal error: jl_options.image_file path too long" );
564
564
}
565
565
jl_options .image_file = free_path ;
0 commit comments