File tree 4 files changed +22
-7
lines changed
4 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ This documents significant changes in the dev branch of ksh 93u+m.
2
2
For full details, see the git log at: https://github.com/ksh93/ksh
3
3
Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library.
4
4
5
+ 2024-01-27:
6
+
7
+ - Fixed: tilde expansion discipline functions (see 2021-03-16) were not
8
+ reinitialised when executing a ksh script without a #! path line.
9
+
5
10
2024-01-23:
6
11
7
12
- Fixed a rare crash or rare incorrect behaviour in .sh.tilde.{get,set}
Original file line number Diff line number Diff line change 18
18
19
19
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
20
20
#define SH_RELEASE_SVER "1.1.0-alpha" /* semantic version number: https://semver.org */
21
- #define SH_RELEASE_DATE "2024-01-23 " /* must be in this format for $((.sh.version)) */
21
+ #define SH_RELEASE_DATE "2024-01-27 " /* must be in this format for $((.sh.version)) */
22
22
#define SH_RELEASE_CPYR "(c) 2020-2024 Contributors to ksh " SH_RELEASE_FORK
23
23
24
24
/* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */
Original file line number Diff line number Diff line change @@ -1537,7 +1537,6 @@ int sh_reinit(char *argv[])
1537
1537
Dt_t * dp ;
1538
1538
int nofree ;
1539
1539
char * savfpath = NULL ;
1540
- sh_onstate (SH_INIT );
1541
1540
sh .subshell = sh .realsubshell = sh .comsub = sh .curenv = sh .jobenv = sh .inuse_bits = sh .fn_depth = sh .dot_depth = 0 ;
1542
1541
sh .envlist = NULL ;
1543
1542
sh .last_root = sh .var_tree ;
@@ -1546,6 +1545,8 @@ int sh_reinit(char *argv[])
1546
1545
sfclose (sh .heredocs );
1547
1546
sh .heredocs = 0 ;
1548
1547
}
1548
+ /* Unset tilde expansion disciplines */
1549
+ _nv_unset (SH_TILDENOD ,NV_RDONLY );
1549
1550
/* save FPATH and treat specially */
1550
1551
if (nv_isattr (FPATHNOD ,NV_EXPORT ))
1551
1552
savfpath = sh_strdup (nv_getval (FPATHNOD ));
@@ -1584,9 +1585,6 @@ int sh_reinit(char *argv[])
1584
1585
nv_setattr (np ,NV_EXPORT ); /* turn off everything except export */
1585
1586
if (cp )
1586
1587
np -> nvalue .cp = cp ; /* replace by string value */
1587
- /* unset discipline */
1588
- if (np -> nvfun && np -> nvfun -> disc )
1589
- np -> nvfun -> disc = NULL ;
1590
1588
}
1591
1589
else
1592
1590
{
@@ -1704,7 +1702,6 @@ int sh_reinit(char *argv[])
1704
1702
/* call user init function, if any */
1705
1703
if (sh .userinit )
1706
1704
(* sh .userinit )(& sh , 1 );
1707
- sh_offstate (SH_INIT );
1708
1705
return 1 ;
1709
1706
}
1710
1707
Original file line number Diff line number Diff line change 2
2
# #
3
3
# This software is part of the ast package #
4
4
# Copyright (c) 1982-2012 AT&T Intellectual Property #
5
- # Copyright (c) 2020-2022 Contributors to ksh 93u+m #
5
+ # Copyright (c) 2020-2024 Contributors to ksh 93u+m #
6
6
# and is licensed under the #
7
7
# Eclipse Public License, Version 2.0 #
8
8
# #
@@ -182,5 +182,18 @@ exp=/usr/local/src/ksh93/ksh
182
182
[[ $got == " $exp " ]] || err_exit " error in special builtin disables .sh.tilde discipline" \
183
183
" (expected $( printf %q " $exp " ) , got $( printf %q " $got " ) )"
184
184
185
+ # ======
186
+
187
+ .sh.tilde.set () { print -n BAD; }
188
+ .sh.tilde.get () { .sh.value=' & WRONG' ; }
189
+ echo ' echo ~okay' > test.sh
190
+ chmod +x test.sh
191
+ ./test.sh > test.out
192
+ got=$( < test.out)
193
+ unset .sh.tilde # removes discipline functions
194
+ exp=~ okay
195
+ [[ $got == " $exp " ]] || err_exit " child script inherits .sh.tilde discipline" \
196
+ " (expected $( printf %q " $exp " ) , got $( printf %q " $got " ) )"
197
+
185
198
# ======
186
199
exit $(( Errors< 125 ? Errors: 125 ))
You can’t perform that action at this time.
0 commit comments