From owner-cvs-src@FreeBSD.ORG Sun Feb 24 16:50:56 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 180C516A401; Sun, 24 Feb 2008 16:50:56 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D20A213C459; Sun, 24 Feb 2008 16:50:55 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1OGotah063807; Sun, 24 Feb 2008 16:50:55 GMT (envelope-from stefanf@repoman.freebsd.org) Received: (from stefanf@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1OGotF9063806; Sun, 24 Feb 2008 16:50:55 GMT (envelope-from stefanf) Message-Id: <200802241650.m1OGotF9063806@repoman.freebsd.org> From: Stefan Farfeleder Date: Sun, 24 Feb 2008 16:50:55 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/bin/sh cd.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2008 16:50:56 -0000 stefanf 2008-02-24 16:50:55 UTC FreeBSD src repository Modified files: bin/sh cd.c Log: Split updatepwd() into two smaller functions. The first one, findpwd(), computes the new path and the second one, updatepwd(), updates the variables PWD, OLDPWD and the path used for the pwd builtin according to the new directory. For a logical directory change, chdir() is now called between those two functions, no longer causing wrong values to be stored in PWD etc. if it fails. PR: 64990, 101316, 120571 Revision Changes Path 1.36 +45 -38 src/bin/sh/cd.c