Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn
From: gwyn@brl-tgr.ARPA (Doug Gwyn )
Newsgroups: net.bugs.usg
Subject: Fix for sh PATH bug
Message-ID: <570@brl-tgr.ARPA>
Date: Fri, 9-Aug-85 07:05:08 EDT
Article-I.D.: brl-tgr.570
Posted: Fri Aug  9 07:05:08 1985
Date-Received: Mon, 12-Aug-85 01:25:15 EDT
References: <807@plus5.UUCP> <5857@utzoo.UUCP> <2563@sun.uucp> <546@brl-tgr.ARPA>
Organization: Ballistic Research Lab
Lines: 26

SYMPTOM:	A trailing : in $PATH or $CDPATH is not interpreted
		as meaning that a null entry (current working
		directory) follows the :

FIX:		The following is for the UNIX System V Release 2.0
		Bourne shell, including the BRL job-control version.
		Earlier Bourne shells are fixed in a similar way,
		modulo the translation into pseudo-Algol 68.

	In file "service.c", function catpath(), change:
		if (*scanp == COLON)
			scanp++;
		path = (*scanp ? scanp : 0);
	to:
		path = *scanp ? scanp + 1 : 0;	/* DAG -- bug fix */

	In the same file, function nextpath(), change:
		if (*scanp == COLON)
			scanp++;

		return(*scanp ? scanp : 0);
	to:
		return *scanp ? scanp + 1 : 0;	/* DAG -- bug fix */

NOTE:		The resulting executable is also 12 bytes smaller
		(VAX version).