Skip to content

Do not rely on short (8+3) names on Windows - #33

Merged
plicease merged 2 commits into
mainfrom
graham/no-short-names
Oct 7, 2026
Merged

plicease merged 2 commits into
mainfrom
graham/no-short-names

Conversation

@plicease

@plicease plicease commented Oct 7, 2026

Copy link
Copy Markdown
Member

Fixes #13, fixes #28.

Short (8+3) names are not created by default on newer versions of Windows, so neither the module nor its tests should depend on them.

Library

  • win32_space_be_gone returns the original path unchanged when no short name without spaces is available. Previously it returned whatever Win32::GetShortPathName gave back (the long path, or undef for a path that doesn't exist).
  • Docs say the result may still contain spaces, and point to the array-ref form of set_alias.

Tests

  • t/lib/TestLib.pm no longer shortens the temp dir. It quotes paths in the generated scripts (cmd, PowerShell, Unix) and in the commands that run them.
  • The PowerShell check uses corpus/true.ps1 off MSWin32, so /bin/sh doesn't eat the backslash (the ttrue.ps1 / corpustrue.ps1 errors in Possible quoting issue with power shell on windows breaks test #13 and test failures under WSL #31).
  • alias_array.t no longer shortens the perl path; the array form quotes each word.
  • alias.t (string form, where quoting is up to the caller) skips when the perl or script path contains a space; alias_array.t covers that case.
  • space_win32.t checks for no spaces when short names exist, and for unchanged paths when they don't.

Testing

  • Linux: passes normally, and also with a space in both the temp dir and the perl path. On main, that setup fails 8 test files.
  • Not tested on Windows: the cmd.exe and PowerShell branches and space_win32.t need a Windows run.

🤖 Generated with Claude Code

Short names are not created by default on newer versions of Windows.

- win32_space_be_gone returns the original path unchanged when no
  short name without spaces is available, and docs say so.
- The test suite quotes paths with spaces instead of shortening them,
  and uses a forward-slash path to corpus/true.ps1 off of MSWin32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plicease
plicease force-pushed the graham/no-short-names branch from 3da7fe1 to ddf53b7 Compare October 7, 2026 15:57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plicease
plicease merged commit 1c8a6b6 into main Oct 7, 2026
21 checks passed
@plicease
plicease deleted the graham/no-short-names branch October 7, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breaks on "Perl in space" with the default of no short path names Possible quoting issue with power shell on windows breaks test

1 participant