[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#687779: release.debian.org: New NMU fixing #679966



Package: release.debian.org
Followup-For: Bug #687779
User: release.debian.org@packages.debian.org
Usertags: unblock

Hi,

I just created an updated ksh package for testing and uploaded
it as an NMU to t-p-u. I have verified my fix to work and the
built-in cd works now properly as it is using all upstream changes
addressing the problem while ignoring other changes.

Attaching the debdiff.

Cheers,

Adrian
diff -ru ksh-93u+-1.1/debian/changelog ksh-93u+-1.2/debian/changelog
--- ksh-93u+-1.1/debian/changelog	2012-10-13 23:58:47.000000000 +0200
+++ ksh-93u+-1.2/debian/changelog	2013-01-02 18:41:55.256504333 +0100
@@ -1,3 +1,12 @@
+ksh (93u+-1.2) testing-proposed-updates; urgency=low
+
+  * Non-maintainer upload.
+  * Fix handling of cd ../../.. and similar using
+    the upstream changes from ee4582a commit, drop previous patch
+    by Jonathan Wiltshire <jmw@debian.org> (Closes: #679966).
+
+ -- John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>  Wed, 02 Jan 2013 18:41:22 +0100
+
 ksh (93u+-1.1) testing-proposed-updates; urgency=low
 
   * Non-maintainer upload.
Only in ksh-93u+-1.1/debian/patches: cddotdot.patch
Only in ksh-93u+-1.2/debian/patches: fix-cd-builtin.patch
diff -ru ksh-93u+-1.1/debian/patches/series ksh-93u+-1.2/debian/patches/series
--- ksh-93u+-1.1/debian/patches/series	2012-10-13 23:54:37.000000000 +0200
+++ ksh-93u+-1.2/debian/patches/series	2013-01-02 18:34:31.359970762 +0100
@@ -2,4 +2,4 @@
 cleanup-man-title.patch
 no-rpath.patch
 handle-removed-working-dir.patch
-cddotdot.patch
+fix-cd-builtin.patch
diff -ru ksh-93u+-1.1/.pc/applied-patches ksh-93u+-1.2/.pc/applied-patches
--- ksh-93u+-1.1/.pc/applied-patches	2013-01-02 18:53:45.594190269 +0100
+++ ksh-93u+-1.2/.pc/applied-patches	2013-01-02 18:34:31.367970552 +0100
@@ -2,4 +2,4 @@
 cleanup-man-title.patch
 no-rpath.patch
 handle-removed-working-dir.patch
-cddotdot.patch
+fix-cd-builtin.patch
Only in ksh-93u+-1.1/.pc: cddotdot.patch
Only in ksh-93u+-1.2/.pc: fix-cd-builtin.patch
diff -ru ksh-93u+-1.1/src/cmd/ksh93/bltins/cd_pwd.c ksh-93u+-1.2/src/cmd/ksh93/bltins/cd_pwd.c
--- ksh-93u+-1.1/src/cmd/ksh93/bltins/cd_pwd.c	2013-01-02 18:53:45.000000000 +0100
+++ ksh-93u+-1.2/src/cmd/ksh93/bltins/cd_pwd.c	2013-01-02 18:34:31.000000000 +0100
@@ -112,23 +112,31 @@
 	if(*dir=='.')
 	{
 		/* test for pathname . ./ .. or ../ */
-		if(*(dp=dir+1) == '.')
-			dp++;
-		if(*dp==0 || *dp=='/')
+		int	n=0;
+		char	*sp;
+		for(dp=dir; *dp=='.'; dp++)
 		{
-			if((dp-dir)==2)
+			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--)
 			{
-				char *sp;
-				sfputr(shp->strbuf,oldpwd,0);
-				if(*dp)
-					sfputr(shp->strbuf,dp+1,0);
-				sp = sfstruse(shp->strbuf);
-				*(dir=strrchr(sp,'/'))=0;
-				if(*dp)
-					strcpy(dir,dp);
-				dir = (char*)sp;
+				while(--sp > oldpwd && *sp!='/');
+				if(sp==oldpwd)
+					break;
+				
 			}
-			cdpath = 0;
+			sfwrite(shp->strbuf,oldpwd,sp+1-oldpwd);
+			sfputr(shp->strbuf,dp,0);
+			dir = sfstruse(shp->strbuf);
 		}
 	}
 	rval = -1;
@@ -205,6 +213,8 @@
 	if(*dir != '/')
 		return(0);
 	nv_putval(opwdnod,oldpwd,NV_RDONLY);
+	if(oldpwd)
+		free(oldpwd);
 	flag = strlen(dir);
 	/* delete trailing '/' */
 	while(--flag>0 && dir[flag]=='/')
@@ -215,8 +225,6 @@
 	nv_scan(shp->track_tree,rehash,(void*)0,NV_TAGGED,NV_TAGGED);
 	path_newdir(shp,shp->pathlist);
 	path_newdir(shp,shp->cdpathlist);
-	if(oldpwd)
-		free(oldpwd);
 	return(0);
 }
 

Reply to: