pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/check-portability



Module Name:    pkgsrc
Committed By:   rillig
Date:           Fri Mar 13 16:20:34 UTC 2020

Modified Files:
        pkgsrc/pkgtools/check-portability: Makefile
        pkgsrc/pkgtools/check-portability/files: check-portability.c

Log Message:
pkgtools/check-portability: update to 19.4.2

Changes since 19.4.1:

Fixed an assertion error when reading binary file, reported by tnn via
private mail.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/check-portability/Makefile
cvs rdiff -u -r1.7 -r1.8 \
    pkgsrc/pkgtools/check-portability/files/check-portability.c

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

Modified files:

Index: pkgsrc/pkgtools/check-portability/Makefile
diff -u pkgsrc/pkgtools/check-portability/Makefile:1.5 pkgsrc/pkgtools/check-portability/Makefile:1.6
--- pkgsrc/pkgtools/check-portability/Makefile:1.5      Fri Mar 13 08:17:18 2020
+++ pkgsrc/pkgtools/check-portability/Makefile  Fri Mar 13 16:20:34 2020
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.5 2020/03/13 08:17:18 rillig Exp $
+# $NetBSD: Makefile,v 1.6 2020/03/13 16:20:34 rillig Exp $
 
-PKGNAME=       check-portability-19.4.1
+PKGNAME=       check-portability-19.4.2
 CATEGORIES=    pkgtools
 DISTFILES=     # none
 

Index: pkgsrc/pkgtools/check-portability/files/check-portability.c
diff -u pkgsrc/pkgtools/check-portability/files/check-portability.c:1.7 pkgsrc/pkgtools/check-portability/files/check-portability.c:1.8
--- pkgsrc/pkgtools/check-portability/files/check-portability.c:1.7     Thu Mar 12 19:45:06 2020
+++ pkgsrc/pkgtools/check-portability/files/check-portability.c Fri Mar 13 16:20:34 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: check-portability.c,v 1.7 2020/03/12 19:45:06 rillig Exp $ */
+/* $NetBSD: check-portability.c,v 1.8 2020/03/13 16:20:34 rillig Exp $ */
 
 /*
  Copyright (c) 2020 Roland Illig
@@ -107,6 +107,12 @@ cstr_index(cstr haystack, cstr needle)
 }
 
 static bool
+cstr_contains_char(cstr haystack, char needle)
+{
+       return memchr(haystack.data, needle, haystack.len);
+}
+
+static bool
 cstr_contains(cstr haystack, cstr needle)
 {
        return cstr_index(haystack, needle) != npos;
@@ -165,6 +171,7 @@ typedef struct {
 static cstr
 str_c(str *s)
 {
+       assert(s->data != nullptr);
        return (cstr) { s->data, s->len };
 }
 
@@ -518,9 +525,11 @@ check_file(cstr filename)
        }
 
        while (str_read_line(&line, f)) {
+               cstr cline = str_c(&line);
+               if (cstr_contains_char(str_c(&line), '\0'))
+                       break;
                lineno++;
                str_charptr(&line);
-               cstr cline = str_c(&line);
 
                checkline_sh_double_brackets(filename, lineno, cline);
                checkline_sh_dollar_random(filename, lineno, cline);



Home | Main Index | Thread Index | Old Index