Skip to content

Normalize Windows backslashes - #54

Merged
lmajano merged 1 commit into
commandbox-modules:masterfrom
loebelectric:master
Jul 30, 2026
Merged

Normalize Windows backslashes#54
lmajano merged 1 commit into
commandbox-modules:masterfrom
loebelectric:master

Conversation

@garyknight

Copy link
Copy Markdown
Contributor

On Windows, fileSystemUtil.makePathRelative() returns paths using backslash separators (e.g. resources\database\migrations). The previous fix attempted to normalize these with replace( path, "\", "/", "all" ), but in CFML "\" is a two-character string literal matching double backslashes \ — not the single backslashes \ that Windows paths actually contain. As a result, the replace was a no-op on Windows and the bug persisted.

This fix corrects the string literal to "" (single backslash) in all three affected locations:

setup() — migrationsDirectory normalization
setup() — seedsDirectory normalization
setMigrationPath() — direct directory setter

This change has no effect on Mac or Linux, where makePathRelative() already returns forward-slash paths and the replace() is a no-op either way.

Type of change

  • Bug Fix

On Windows, fileSystemUtil.makePathRelative() returns paths using backslash separators (e.g. resources\database\migrations\). The previous fix attempted to normalize these with replace( path, "\\", "/", "all" ), but in CFML "\\" is a two-character string literal matching double backslashes \\ — not the single backslashes \ that Windows paths actually contain. As a result, the replace was a no-op on Windows and the bug persisted.

This fix corrects the string literal to "\" (single backslash) in all three affected locations:

setup() — migrationsDirectory normalization
setup() — seedsDirectory normalization
setMigrationPath() — direct directory setter

This change has no effect on Mac or Linux, where makePathRelative() already returns forward-slash paths and the replace() is a no-op either way.
@lmajano
lmajano merged commit 5133afa into commandbox-modules:master Jul 30, 2026
2 checks passed
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.

2 participants