From 1a151afc5e79c32513fc2e2935c2b0563d5be398 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 29 Jul 1996 20:46:41 +0000 Subject: Fixed a bug causing a CPU loop if dist'ing a file whose parent dir doesn't exist on the target machine. --- usr.bin/rdistd/filesys.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr.bin/rdistd/filesys.c b/usr.bin/rdistd/filesys.c index 34df4bf98ed..33b30ca6d07 100644 --- a/usr.bin/rdistd/filesys.c +++ b/usr.bin/rdistd/filesys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filesys.c,v 1.3 1996/06/26 05:38:21 deraadt Exp $ */ +/* $OpenBSD: filesys.c,v 1.4 1996/07/29 20:46:40 millert Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint static char RCSid[] = -"$OpenBSD: filesys.c,v 1.3 1996/06/26 05:38:21 deraadt Exp $"; +"$OpenBSD: filesys.c,v 1.4 1996/07/29 20:46:40 millert Exp $"; static char sccsid[] = "@(#)filesys.c"; @@ -119,9 +119,13 @@ char *find_file(pathname, statbuf, isvalid) * Normally we want to change /dir1/dir2/file * into "/dir1/dir2/." */ - if (p = (char *) strrchr(file, '/')) { - *++p = '.'; - *++p = CNULL; + if ((p = (char *) strrchr(file, '/'))) { + if (strcmp(p, "/.") == 0) { + *p = CNULL; + } else { + *++p = '.'; + *++p = CNULL; + } } else { /* * Couldn't find anything, so give up. -- cgit v1.2.3