Commit ca75044
committed
fix(fileio): expand ~ via passwd/AppData home when HOME is unset (GNU get_homedir)
The Windows pdump generation failed with file-missing 'Opening directory ~':
directory-files "~" -> expand-file-name -> home_directory_for_expand_file_name read
only getenv("HOME"). On the Windows build runner HOME is unset (only APPDATA/
USERPROFILE), so `~` stayed literal and the listing failed fatally at startup.
Reproduced locally on Linux with 'env -u HOME' (`~` -> "~"), which let me fix and
verify without Windows CI round-trips. Mirror GNU's get_homedir (fileio.c): when HOME
is unset, fall back to the current user's home -- getpwnam($LOGNAME/$USER) then
getpwuid(getuid()) on Unix; the AppData-derived home (APPDATA/USERPROFILE/"C:/", where
GNU w32.c init_environment puts HOME) on Windows -- via new current_user_home_bytes(),
wired into both home_directory_for_expand_file_name and home_env_bytes.
Verified: 'env -u HOME neomacs' now expands `~` to the passwd home and directory-files
"~" succeeds; with HOME set, behavior is unchanged.1 parent 2759eef commit ca75044
1 file changed
Lines changed: 58 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
308 | 349 | | |
309 | 350 | | |
310 | 351 | | |
| |||
1867 | 1908 | | |
1868 | 1909 | | |
1869 | 1910 | | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
1873 | 1920 | | |
| 1921 | + | |
1874 | 1922 | | |
1875 | 1923 | | |
1876 | 1924 | | |
| |||
0 commit comments