Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/unzip Fix a logic error: when renaming a file, strip...



details:   https://anonhg.NetBSD.org/src/rev/184f491fe3e7
branches:  trunk
changeset: 767273:184f491fe3e7
user:      wiz <wiz%NetBSD.org@localhost>
date:      Thu Jul 14 06:35:30 2011 +0000

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

diffstat:

 usr.bin/unzip/unzip.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 6ccddc48d670 -r 184f491fe3e7 usr.bin/unzip/unzip.c
--- a/usr.bin/unzip/unzip.c     Thu Jul 14 05:46:04 2011 +0000
+++ b/usr.bin/unzip/unzip.c     Thu Jul 14 06:35:30 2011 +0000
@@ -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 <joerg%NetBSD.org@localhost>
@@ -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:



Home | Main Index | Thread Index | Old Index