Skip to content

Commit

Permalink
conf.tab: Support //UNC/paths by default on Cygwin
Browse files Browse the repository at this point in the history
In the Cygwin port for ksh 93u+m/1.0.8, Roland Mainz had patched
astconf(3) to hardcode a value 1 for PATH_LEADING_SLASHES, which
is necessary to enable the built-in support for the double initial
slash used for UNC network paths on Windows.

Previously, enabling this support required manually adding the
value triplet "PATH_LEADING_SLASHES - 1" to the _AST_FEATURES
environment variable, but the documentation for that was so obscure
and indirect it might as well have been undocuemnted (it would
require reading the --man self-doc of the getconf, dirname and
basename path-bound built-ins).

This commit adds a PATH_LEADING_SLASHES entry to conf.tab that will
cause this value to be hardcoded to 1 in the generated conftab.c
file on Cygwin, causing UNC path support to always be enabled on
that system.
  • Loading branch information
McDutchie committed Jul 2, 2024
1 parent b9f2ab6 commit 5188590
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ This documents significant changes in the 1.0 branch of ksh 93u+m.
For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0
Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library.

2024-07-02:

- Support for UNC paths (//server/dir) is now enabled by default on Cygwin.

2024-06-30:

- Fixed: the 'hash' and 'alias -t' commands no longer autoload functions
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
#define SH_RELEASE_SVER "1.0.9-beta" /* semantic version number: https://semver.org */
#define SH_RELEASE_DATE "2024-06-30" /* must be in this format for $((.sh.version)) */
#define SH_RELEASE_DATE "2024-07-02" /* must be in this format for $((.sh.version)) */
#define SH_RELEASE_CPYR "(c) 2020-2024 Contributors to ksh " SH_RELEASE_FORK

/* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */
Expand Down
10 changes: 8 additions & 2 deletions src/lib/libast/comp/conf.tab
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# posix { getconf limits } macro table
#
# @(#)conf.tab (AT&T Research) 2010-06-28
# @(#)conf.tab (ksh 93u+m) 2024-07-01
#
# name standard section call flags [ header ... ] [ value ... ]
# name standard call section flags [ header ... ] [ value ... ]
#
# name: sans prefix
# standard: AST, C, POSIX, SVID, XOPEN, <vendor> { SCO, SGI, SUN, ... }
Expand Down Expand Up @@ -342,6 +342,12 @@ PATH AST CS 1 MU sh{
# DEFPATH should have been exported from package(1)
echo "\\"$DEFPATH\\""
}
PATH_LEADING_SLASHES AST CS 1 M sh{
# HOSTTYPE should have been exported from package(1)
case $HOSTTYPE in
cygwin.*) echo "\\"1\\"" ;; # support UNC paths (with two leading slashes)
esac
}
PATH_MAX POSIX PC 1 CDLMUX MAXPATHLEN 1024
PBS POSIX SC 2 FUW
PBS_ACCOUNTING POSIX SC 2 FUW
Expand Down

0 comments on commit 5188590

Please sign in to comment.