NetBSD Problem Report #43517

From www@NetBSD.org  Fri Jun 25 16:20:28 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2263563BA54
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 25 Jun 2010 16:20:28 +0000 (UTC)
Message-Id: <20100625162027.E12BB63BA50@www.NetBSD.org>
Date: Fri, 25 Jun 2010 16:20:27 +0000 (UTC)
From: lacombar@gmail.com
Reply-To: lacombar@gmail.com
To: gnats-bugs@NetBSD.org
Subject: patch(1) does not fail when used with unknown option
X-Send-Pr-Version: www-1.0

>Number:         43517
>Category:       bin
>Synopsis:       patch(1) does not fail when used with unknown option
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 25 16:25:00 +0000 2010
>Closed-Date:    Sat May 21 05:13:40 +0000 2011
>Last-Modified:  Sat May 21 05:13:40 +0000 2011
>Originator:     Arnaud Lacombe
>Release:        netbsd-5
>Organization:
n/a
>Environment:
NetBSD bla 5.99.25 NetBSD 5.99.25 (GENERIC) #0: Tue Apr 27 22:29:06 EDT 2010  al@bla:/misc/build/obj/sys/arch/i386/compile/GENERIC i386
>Description:
When used with unknown options, patch(1) returns a success, however, patch is not applied.
>How-To-Repeat:
% echo foo > orig
% echo bar > changed
% diff -u orig changed > change  
% patch --no-backup-if-mismatch < change
patch: unknown option -- no-backup-if-mismatch
usage: patch [-bCcEeflNnRstuv] [-B backup-prefix] [-D symbol] [-d directory]
             [-F max-fuzz] [-i patchfile] [-o out-file] [-p strip-count]
             [-r rej-name] [-V t | nil | never] [-x number] [-z backup-ext]
             [--posix] [origfile [patchfile]]
       patch <patchfile
% echo $?
0
% cat orig 
foo
% patch < change                       
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- orig       2010-06-25 12:13:51.000000000 -0400
|+++ changed    2010-06-25 12:14:02.000000000 -0400
--------------------------
Patching file orig using Plan A...
Hunk #1 succeeded at 1.
done
% echo $?
0
% cat orig
bar

>Fix:
should be trivial :)

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43517 CVS commit: src/usr.bin/patch
Date: Sat, 26 Mar 2011 21:45:48 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Sat Mar 26 21:45:48 UTC 2011

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

 Log Message:
 Exit with EXIT_FAILURE for invalid arguments. PR 43517.


 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.28 src/usr.bin/patch/patch.c

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

State-Changed-From-To: open->pending-pullups
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 01 May 2011 02:46:09 +0000
State-Changed-Why:
pullup-5 #1614


From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43517 CVS commit: [netbsd-5] src/usr.bin/patch
Date: Fri, 20 May 2011 19:22:20 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Fri May 20 19:22:20 UTC 2011

 Modified Files:
 	src/usr.bin/patch [netbsd-5]: patch.c

 Log Message:
 Pull up following revision(s) (requested by dholland in ticket #1614):
 	usr.bin/patch/patch.c: revision 1.28
 Exit with EXIT_FAILURE for invalid arguments. PR 43517.


 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.27.4.1 src/usr.bin/patch/patch.c

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

State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 21 May 2011 05:13:40 +0000
State-Changed-Why:
fixed, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.