diff --git a/collects/scribblings/reference/startup.scrbl b/collects/scribblings/reference/startup.scrbl index fcca28afc8..c38310af17 100644 --- a/collects/scribblings/reference/startup.scrbl +++ b/collects/scribblings/reference/startup.scrbl @@ -242,7 +242,12 @@ flags: @item{@FlagFirst{X} @nonterm{dir} or @DFlagFirst{collects} @nonterm{dir} : Sets @nonterm{dir} as the path to the main collection of libraries by making @racket[(find-system-path - 'collects-dir)] produce @nonterm{dir}.} + 'collects-dir)] produce @nonterm{dir}. If @nonterm{dir} is an + empty string, then @racket[(find-system-path 'collects-dir)] + returns @filepath{.}, but + @racket[current-library-collection-paths] is initialized to + the empty list and @racket[use-collection-link-paths] is + initialized to @racket[#f].} @item{@FlagFirst{S} @nonterm{dir} or @DFlagFirst{search} @nonterm{dir} : Adds @nonterm{dir} to the default library diff --git a/src/racket/cmdline.inc b/src/racket/cmdline.inc index 8fd36f5f7a..3372ca2af3 100644 --- a/src/racket/cmdline.inc +++ b/src/racket/cmdline.inc @@ -860,7 +860,11 @@ static int run_from_cmd_line(int argc, char *_argv[], } argv++; --argc; - collects_path = check_make_path(prog, real_switch, argv[0]); + if (!*(argv[0])) { + /* #f => no collects path */ + collects_path = scheme_false; + } else + collects_path = check_make_path(prog, real_switch, argv[0]); was_config_flag = 1; break; case 'A': @@ -1175,16 +1179,19 @@ static int run_from_cmd_line(int argc, char *_argv[], #ifndef NO_FILE_SYSTEM_UTILS /* Setup path for "collects" collection directory: */ if (!collects_path) { - if (!_coldir[_coldir_offset]) { - /* empty list of directories => don't set collection dirs - and don't use collection links files */ - skip_coll_dirs = 1; - scheme_set_ignore_link_paths(1); - collects_path = scheme_make_path("."); - } else + if (!_coldir[_coldir_offset]) + collects_path = scheme_false; + else collects_path = scheme_make_path(_coldir XFORM_OK_PLUS _coldir_offset); - } else + } else if (!SCHEME_FALSEP(collects_path)) collects_path = scheme_path_to_complete_path(collects_path, NULL); + if (SCHEME_FALSEP(collects_path)) { + /* empty list of directories => don't set collection dirs + and don't use collection links files */ + skip_coll_dirs = 1; + scheme_set_ignore_link_paths(1); + collects_path = scheme_make_path("."); + } scheme_set_collects_path(collects_path); /* Make list of additional collection paths: */ @@ -1343,7 +1350,7 @@ static int run_from_cmd_line(int argc, char *_argv[], " -z, --text-repl : Use text `read-eval-print-loop' for -i\n" # endif " -I : Set to \n" - " -X , --collects : Main collects at \n" + " -X , --collects : Main collects at (or \"\" disables all)\n" " -S , --search : More collects at (after main collects)\n" " -A , --addon : Addon directory at \n" " -K , --links : User-specific collection links at \n"