Module Name:    src
Committed By:   wiz
Date:           Thu Jul 14 06:35:30 UTC 2011

Modified Files:
        src/usr.bin/unzip: unzip.c

Log Message:
Fix a logic error: when renaming a file, strip trailing \n from file name.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/unzip/unzip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.14 src/usr.bin/unzip/unzip.c:1.15
--- src/usr.bin/unzip/unzip.c:1.14	Mon May 10 15:45:22 2010
+++ src/usr.bin/unzip/unzip.c	Thu Jul 14 06:35:30 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.14 2010/05/10 15:45:22 joerg Exp $ */
+/* $NetBSD: unzip.c,v 1.15 2011/07/14 06:35:30 wiz Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Joerg Sonnenberger <jo...@netbsd.org>
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: unzip.c,v 1.14 2010/05/10 15:45:22 joerg Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.15 2011/07/14 06:35:30 wiz Exp $");
 
 #include <sys/queue.h>
 #include <sys/stat.h>
@@ -449,7 +449,7 @@
 			*path = NULL;
 			alen = 0;
 			len = getline(path, &alen, stdin);
-			if ((*path)[len - 1] != '\n')
+			if ((*path)[len - 1] == '\n')
 				(*path)[len - 1] = '\0';
 			return 0;
 		default:

Reply via email to