pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/diffbreaker/files/diffbreaker



Module Name:    pkgsrc
Committed By:   nat
Date:           Thu Jun 18 13:38:49 UTC 2020

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

Log Message:
Use secondary buffer as an intermediatory to fix compilation with SSP_FORTIFY.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
    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/files/diffbreaker/diffbreaker.c
diff -u pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.6 pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.7
--- pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.6        Thu Jun 18 00:00:25 2020
+++ pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c    Thu Jun 18 13:38:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: diffbreaker.c,v 1.6 2020/06/18 00:00:25 nat Exp $ */
+/* $NetBSD: diffbreaker.c,v 1.7 2020/06/18 13:38:49 nat Exp $ */
 
 /*-
  * Copyright (c) 2018, 2019 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -101,9 +101,8 @@ mark_dirty(void)
                                continue;
                        }
                        if (*ORIGBUF(i) == '+') {
-                               if (j != i)
-                                       strncpy(ORIGBUF(j), ORIGBUF(i), len);
-                               *ORIGBUF(j) = ' ';
+                               strncpy(NEWBUF(j), ORIGBUF(i), len);
+                               *NEWBUF(j) = ' ';
                                action[j] = 0;
                        }
                        break;
@@ -114,8 +113,7 @@ mark_dirty(void)
                        pending = false;
                        writesect = false;
                        action[j] = action[i];
-                       if (j != i)
-                               strncpy(ORIGBUF(j), ORIGBUF(i), len);
+                       strncpy(NEWBUF(j), ORIGBUF(i), len);
                        break;
                case 6: /* --- */
                        if (pending == false && writesect == false)
@@ -126,13 +124,11 @@ mark_dirty(void)
                        pending = true;
                        writetome = false;
                        writesect = true;
-                       if (j != i)
-                               strncpy(ORIGBUF(j), ORIGBUF(i), len);
+                       strncpy(NEWBUF(j), ORIGBUF(i), len);
                        action[j] = action[i];
                        break;
                case 7: /* +++ */
-                       if (j != i)
-                               strncpy(ORIGBUF(j), ORIGBUF(i), len);
+                       strncpy(NEWBUF(j), ORIGBUF(i), len);
                        action[j] = action[i];
                        break;
                case 1: /* unselected change */
@@ -141,11 +137,11 @@ mark_dirty(void)
                        writetome = true;
                        /* fallthrough */
                default:
-                       if (j != i)
-                               strncpy(ORIGBUF(j), ORIGBUF(i), len);
+                       strncpy(NEWBUF(j), ORIGBUF(i), len);
                        action[j] = action[i];
                        break;
                }
+               strncpy(ORIGBUF(j), NEWBUF(j), len);
                j++;
        }
        totalLines = display ? j-- : 0;



Home | Main Index | Thread Index | Old Index