parse_path_argument() unconditionally makes the passed path absolute,
without handling '~' of any sort. I think this generally makes sense
in most tools, since ~ expansion is typically done by the shell
and we wouldn't be seeing them in the first place and hence special
casing is not worth it. But in run0 let's explicit enable '~'.
break;
case 'D':
- /* Root will be manually suppressed later. */
- r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_working_directory);
+ if (streq(optarg, "~"))
+ r = free_and_strdup_warn(&arg_working_directory, optarg);
+ else
+ /* Root will be manually suppressed later. */
+ r = parse_path_argument(optarg, /* suppress_root= */ false, &arg_working_directory);
if (r < 0)
return r;