user/4993: diff3 doesn't handle filenames with '-' at the beginning

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

user/4993: diff3 doesn't handle filenames with '-' at the beginning

Jason Wright-2
>Number:         4993
>Category:       user
>Synopsis:       diff3 doesn't handle filenames with '-' at the beginning
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 28 04:30:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jason Wright
>Release:        current
>Organization:
net
>Environment:
       
        System      : OpenBSD 3.8
        Architecture: OpenBSD.i386
        Machine     : i386
>Description:
        # diff3 -- -file1 file2 file3
        diff3 calls diff -file1 file2... oops

>How-To-Repeat:
        see above... also there's a coredump from diff3prog
when called without this diff... haven't diagnosed that one yet.

>Fix:
        The last addition of '--' probably isn't necessary as the
mktemp files will not have '-' at the beginning, but seems like
good practice.

Index: diff3.ksh
===================================================================
RCS file: /cvs/src/usr.bin/diff3/diff3.ksh,v
retrieving revision 1.2
diff -u -r1.2 diff3.ksh
--- diff3.ksh 31 Jul 2003 11:16:58 -0000 1.2
+++ diff3.ksh 28 Jan 2006 04:15:25 -0000
@@ -59,7 +59,7 @@
  exit 1
 fi
 trap "/bin/rm -f $TMP1 $TMP2" 0 1 2 13 15
-diff $dflags $1 $3 > $TMP1
-diff $dflags $2 $3 > $TMP2
-$diff3prog $d3flags $TMP1 $TMP2 $1 $2 $3
+diff $dflags -- $1 $3 > $TMP1
+diff $dflags -- $2 $3 > $TMP2
+$diff3prog $d3flags -- $TMP1 $TMP2 $1 $2 $3
 exit $?


>Release-Note:
>Audit-Trail:
>Unformatted: