pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/diffbreaker



Module Name:    pkgsrc
Committed By:   nat
Date:           Wed Jun 17 11:45:08 UTC 2020

Modified Files:
        pkgsrc/devel/diffbreaker: Makefile
        pkgsrc/devel/diffbreaker/files/diffbreaker: diffbreaker.c

Log Message:
Exclude lines that are not part of the diff better.
Simplify file read function.

Bump diffbreaker version.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/diffbreaker/Makefile
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c

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

Modified files:

Index: pkgsrc/devel/diffbreaker/Makefile
diff -u pkgsrc/devel/diffbreaker/Makefile:1.2 pkgsrc/devel/diffbreaker/Makefile:1.3
--- pkgsrc/devel/diffbreaker/Makefile:1.2       Sat May 30 22:45:07 2020
+++ pkgsrc/devel/diffbreaker/Makefile   Wed Jun 17 11:45:08 2020
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.2 2020/05/30 22:45:07 nat Exp $
+# $NetBSD: Makefile,v 1.3 2020/06/17 11:45:08 nat Exp $
 
-PKGNAME=       diffbreaker-0.1
+PKGNAME=       diffbreaker-0.2
 #PKGREVISION=  1
 CATEGORIES=    devel
 

Index: pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c
diff -u pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.2 pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.3
--- pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.2        Wed Jun 17 10:52:03 2020
+++ pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c    Wed Jun 17 11:45:08 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: diffbreaker.c,v 1.2 2020/06/17 10:52:03 nat Exp $ */
+/* $NetBSD: diffbreaker.c,v 1.3 2020/06/17 11:45:08 nat Exp $ */
 
 /*-
  * Copyright (c) 2018, 2019 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -439,20 +439,12 @@ read_data_to_buffer(char *myFile)
        memset(buffer, 0, (size_t)totalalloc * sizeof(*buffer));
        memset(newbuffer, 0, (size_t)totalalloc * sizeof(*newbuffer));
 
-       l = 0;
        j = n = 0;
        lseek(fd, 0, SEEK_SET);
        while ((nr = read(fd, line, sizeof(line))) > 0) {
                for (i = 0; i < nr; i++) {
                        data = line[i];
-                       l++;
                        *(ORIGBUF(j) + n++) = data;
-                       if (l == sizeof(line)) {
-                               l = 0;
-                               n = 0;
-                               j++;
-                               continue;
-                       }
                        if (data == '\n') {
                                myaction = 0;
                                if (*ORIGBUF(j) == '-' && *(ORIGBUF(j) + 1) ==
@@ -473,8 +465,11 @@ read_data_to_buffer(char *myFile)
                                action[j] = myaction;
                                if (action[j] != 4)
                                        j++;
+                               else {
+                                       memset(ORIGBUF(j), 0, (size_t)cpl);
+                                       action[j] = 0;
+                               }
                                n = 0;
-                               l = 0;
                        }
                }
        }



Home | Main Index | Thread Index | Old Index