19315768 ksh93(1) lacks description of Parameter Expansions for :=, :?, and :+ s11u3-sru
authorLijo George<lijo.x.george@oracle.com>
Thu, 23 Feb 2017 01:21:11 -0800
branchs11u3-sru
changeset 7684 df734e7c2a96
parent 7682 8e5bb71809b9
child 7690 cca822116da5
19315768 ksh93(1) lacks description of Parameter Expansions for :=, :?, and :+ 23319761 cd going dotty by removing leading periods in dir names
components/ksh93/Makefile
components/ksh93/ksh93.p5m
components/ksh93/patches/23319761.patch
--- a/components/ksh93/Makefile	Tue Feb 21 05:41:26 2017 -0800
+++ b/components/ksh93/Makefile	Thu Feb 23 01:21:11 2017 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -84,7 +84,7 @@
                      19907453.patch 22461939.patch \
                      22550551.patch 22561374.patch \
                      22964126.patch 22964338.patch \
-                     22964358.patch
+                     22964358.patch 23319761.patch
 
 # Fixup HOSTTYPE to match uname output and bits
 HOSTTYPE32=sol11.$(shell uname -p)
--- a/components/ksh93/ksh93.p5m	Tue Feb 21 05:41:26 2017 -0800
+++ b/components/ksh93/ksh93.p5m	Thu Feb 23 01:21:11 2017 -0800
@@ -18,12 +18,13 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 # The man pages are all at the top of a "files" directory; setting the hash to
 # point to the files therein.
 <transform file path=usr/share/man/man.+/(.+)$ -> set action.hash %<1> >
+<transform file path=usr/share/man/man1/ksh.1$ -> set action.hash src/cmd/ksh93/sh.1>
 # Bypassing the mangler for these files because they are pre-Solarified.
 <transform file path=usr/share/man/.+$ -> add mangler.bypass true >
 set name=pkg.fmri \
@@ -101,7 +102,7 @@
 dir  path=usr/share/man/man1
 file path=usr/share/man/man1/alias.1
 file path=usr/share/man/man1/jsh.1
-file path=usr/share/man/man1/ksh.1
+file src/cmd/ksh93/sh.1 path=usr/share/man/man1/ksh.1
 file path=usr/share/man/man1/ksh93.1
 file path=usr/share/man/man1/rksh.1
 file path=usr/share/man/man1/sh.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/23319761.patch	Thu Feb 23 01:21:11 2017 -0800
@@ -0,0 +1,51 @@
+This fix comes from the community, this patch ports the relevant 
+changes from the upstream 2013-10-10-alpha version which fixed the issue.
+--- INIT.2012-08-01.old/src/cmd/ksh93/bltins/cd_pwd.c	2016-06-28 04:05:14.983264679 -0700
++++ INIT.2012-08-01/src/cmd/ksh93/bltins/cd_pwd.c	2016-06-28 04:12:16.937817270 -0700
+@@ -109,34 +109,20 @@
+ 		if(!oldpwd)
+ 			oldpwd = path_pwd(shp,1);
+ 	}
+-	if(*dir=='.')
++	if(*dir!='/')
+ 	{
+-		/* test for pathname . ./ .. or ../ */
+-		int	n=0;
+-		char	*sp;
+-		for(dp=dir; *dp=='.'; dp++)
++		/* check for leading .. */
++		char *cp;
++		sfprintf(shp->strbuf,"%s",dir);
++		cp = sfstruse(shp->strbuf);
++		pathcanon(cp, 0);
++		if(cp[0]=='.' && cp[1]=='.' && (cp[2]=='/' || cp[2]==0))
+ 		{
+-			if(*++dp=='.' && (*++dp=='/' || *dp==0))
+-				n++;
+-			else if(*dp && *dp!='/')
+-				break;
+-			if(*dp==0)
+-				break;
+-		}
+-		if(n)	
+-		{
+-			cdpath = 0;
+-			sp = oldpwd + strlen(oldpwd);
+-			while(n--)
+-			{
+-				while(--sp > oldpwd && *sp!='/');
+-				if(sp==oldpwd)
+-					break;
+-				
+-			}
+-			sfwrite(shp->strbuf,oldpwd,sp+1-oldpwd);
+-			sfputr(shp->strbuf,dp,0);
+-			dir = sfstruse(shp->strbuf);
++			if(!shp->strbuf2)
++				shp->strbuf2 = sfstropen();
++			sfprintf(shp->strbuf2,"%s/%s",oldpwd,cp);
++			dir = sfstruse(shp->strbuf2);
++			pathcanon(dir, 0);
+ 		}
+ 	}
+ 	rval = -1;