Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 1998 10:15:45 +0200 (CEST)
From:      xcejka00@dcse.fee.vutbr.cz
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/6521: "rmdir -p x/y/z/" fails
Message-ID:  <199805050815.KAA00738@pccejkar.dcse.fee.vutbr.cz>

next in thread | raw e-mail | index | archive | help

>Number:         6521
>Category:       bin
>Synopsis:       "rmdir -p x/y/z/" fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May  5 01:20:00 PDT 1998
>Last-Modified:
>Originator:     Rudolf Cejka
>Organization:
FEE TU Brno, Czech Republic
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	It does not matter, blankly -current.

>Description:

	Look at How-To-Repeat.

>How-To-Repeat:

	# mkdir -p x/y/z/
	# rmdir -p x/y/z/	% Note on trailing slash. This command cannot
				% be bug, I think...
	rmdir: x/y/z: No such file or directory
				% Hmm. But directory z was removed, x and y
				% remain...

>Fix:
	
	Here is a small patch. But I don't think, it is the best solution:


	--- rmdir.c	Mon May  4 14:01:05 1998
	***************
	*** 94,99 ****
	--- 94,103 ----
	  {
	  	char *p;
	  
	+ 	p = strchr(path, '\0');
	+ 	while (--p > path && *p == '/')
	+ 		;
	+ 	*++p = '\0';
	  	while ((p = strrchr(path, '/')) != NULL) {
	  		/* Delete trailing slashes. */
	  		while (--p > path && *p == '/')

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805050815.KAA00738>