From 71d22747e2aa90e1d6f19177cff0275d011c3fb3 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Fri, 13 Mar 2026 19:18:50 +1100 Subject: [PATCH] further slash fixes for winlnk on unix-like platforms --- src/bootsupport/modules/punk/winlnk-0.1.0.tm | 6 +++++- src/modules/punk/winlnk-999999.0a1.0.tm | 6 +++++- .../src/bootsupport/modules/punk/winlnk-0.1.0.tm | 6 +++++- .../src/bootsupport/modules/punk/winlnk-0.1.0.tm | 6 +++++- src/vfs/_vfscommon.vfs/modules/punk/winlnk-0.1.0.tm | 6 +++++- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/bootsupport/modules/punk/winlnk-0.1.0.tm b/src/bootsupport/modules/punk/winlnk-0.1.0.tm index c9e1f157..6b912f5d 100644 --- a/src/bootsupport/modules/punk/winlnk-0.1.0.tm +++ b/src/bootsupport/modules/punk/winlnk-0.1.0.tm @@ -615,7 +615,10 @@ tcl::namespace::eval punk::winlnk { if {"windows" eq $::tcl_platform(platform)} { set link_target [file join $localbase_path $suffix_path] } else { + set suffix_path [string map {\\ /} $suffix_path] if {[regexp {([a-zA-Z]):\\(.*)} $localbase_path _match drive_letter tail]} { + set localbase_path [string map {\\ /} $localbase_path] + set tail [string map {\\ /} $tail] set link_target "" #shortcut basepath is a windows path with drive letter - try to resolve it on unix by looking for a corresponding mount from fstab or a point under /mnt set mountinfo [exec mount] @@ -643,7 +646,8 @@ tcl::namespace::eval punk::winlnk { if {[file exists /mnt/$op_drive_letter]} { set link_target [file join /mnt/$op_drive_letter $tail $suffix_path] } else { - #leave as is - probably won't resolve correctly but we have no better option + #leave as is except for backslashes converted to forward + #- probably won't resolve correctly unless the unix system has a folder named drive_letter: in the current folder with a copy of the original filestructure. set link_target [file join $localbase_path $suffix_path] } } diff --git a/src/modules/punk/winlnk-999999.0a1.0.tm b/src/modules/punk/winlnk-999999.0a1.0.tm index 77bf7f55..d2530600 100644 --- a/src/modules/punk/winlnk-999999.0a1.0.tm +++ b/src/modules/punk/winlnk-999999.0a1.0.tm @@ -615,7 +615,10 @@ tcl::namespace::eval punk::winlnk { if {"windows" eq $::tcl_platform(platform)} { set link_target [file join $localbase_path $suffix_path] } else { + set suffix_path [string map {\\ /} $suffix_path] if {[regexp {([a-zA-Z]):\\(.*)} $localbase_path _match drive_letter tail]} { + set localbase_path [string map {\\ /} $localbase_path] + set tail [string map {\\ /} $tail] set link_target "" #shortcut basepath is a windows path with drive letter - try to resolve it on unix by looking for a corresponding mount from fstab or a point under /mnt set mountinfo [exec mount] @@ -643,7 +646,8 @@ tcl::namespace::eval punk::winlnk { if {[file exists /mnt/$op_drive_letter]} { set link_target [file join /mnt/$op_drive_letter $tail $suffix_path] } else { - #leave as is - probably won't resolve correctly but we have no better option + #leave as is except for backslashes converted to forward + #- probably won't resolve correctly unless the unix system has a folder named drive_letter: in the current folder with a copy of the original filestructure. set link_target [file join $localbase_path $suffix_path] } } diff --git a/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm b/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm index c9e1f157..6b912f5d 100644 --- a/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm +++ b/src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm @@ -615,7 +615,10 @@ tcl::namespace::eval punk::winlnk { if {"windows" eq $::tcl_platform(platform)} { set link_target [file join $localbase_path $suffix_path] } else { + set suffix_path [string map {\\ /} $suffix_path] if {[regexp {([a-zA-Z]):\\(.*)} $localbase_path _match drive_letter tail]} { + set localbase_path [string map {\\ /} $localbase_path] + set tail [string map {\\ /} $tail] set link_target "" #shortcut basepath is a windows path with drive letter - try to resolve it on unix by looking for a corresponding mount from fstab or a point under /mnt set mountinfo [exec mount] @@ -643,7 +646,8 @@ tcl::namespace::eval punk::winlnk { if {[file exists /mnt/$op_drive_letter]} { set link_target [file join /mnt/$op_drive_letter $tail $suffix_path] } else { - #leave as is - probably won't resolve correctly but we have no better option + #leave as is except for backslashes converted to forward + #- probably won't resolve correctly unless the unix system has a folder named drive_letter: in the current folder with a copy of the original filestructure. set link_target [file join $localbase_path $suffix_path] } } diff --git a/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm b/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm index c9e1f157..6b912f5d 100644 --- a/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm +++ b/src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/winlnk-0.1.0.tm @@ -615,7 +615,10 @@ tcl::namespace::eval punk::winlnk { if {"windows" eq $::tcl_platform(platform)} { set link_target [file join $localbase_path $suffix_path] } else { + set suffix_path [string map {\\ /} $suffix_path] if {[regexp {([a-zA-Z]):\\(.*)} $localbase_path _match drive_letter tail]} { + set localbase_path [string map {\\ /} $localbase_path] + set tail [string map {\\ /} $tail] set link_target "" #shortcut basepath is a windows path with drive letter - try to resolve it on unix by looking for a corresponding mount from fstab or a point under /mnt set mountinfo [exec mount] @@ -643,7 +646,8 @@ tcl::namespace::eval punk::winlnk { if {[file exists /mnt/$op_drive_letter]} { set link_target [file join /mnt/$op_drive_letter $tail $suffix_path] } else { - #leave as is - probably won't resolve correctly but we have no better option + #leave as is except for backslashes converted to forward + #- probably won't resolve correctly unless the unix system has a folder named drive_letter: in the current folder with a copy of the original filestructure. set link_target [file join $localbase_path $suffix_path] } } diff --git a/src/vfs/_vfscommon.vfs/modules/punk/winlnk-0.1.0.tm b/src/vfs/_vfscommon.vfs/modules/punk/winlnk-0.1.0.tm index c9e1f157..6b912f5d 100644 --- a/src/vfs/_vfscommon.vfs/modules/punk/winlnk-0.1.0.tm +++ b/src/vfs/_vfscommon.vfs/modules/punk/winlnk-0.1.0.tm @@ -615,7 +615,10 @@ tcl::namespace::eval punk::winlnk { if {"windows" eq $::tcl_platform(platform)} { set link_target [file join $localbase_path $suffix_path] } else { + set suffix_path [string map {\\ /} $suffix_path] if {[regexp {([a-zA-Z]):\\(.*)} $localbase_path _match drive_letter tail]} { + set localbase_path [string map {\\ /} $localbase_path] + set tail [string map {\\ /} $tail] set link_target "" #shortcut basepath is a windows path with drive letter - try to resolve it on unix by looking for a corresponding mount from fstab or a point under /mnt set mountinfo [exec mount] @@ -643,7 +646,8 @@ tcl::namespace::eval punk::winlnk { if {[file exists /mnt/$op_drive_letter]} { set link_target [file join /mnt/$op_drive_letter $tail $suffix_path] } else { - #leave as is - probably won't resolve correctly but we have no better option + #leave as is except for backslashes converted to forward + #- probably won't resolve correctly unless the unix system has a folder named drive_letter: in the current folder with a copy of the original filestructure. set link_target [file join $localbase_path $suffix_path] } }