Sat Mar 14 09:18:49 2020 UTC ()
pkgtools/check-portability: update to 19.4.3

Changes since 19.4.2:

Fixed a crash when a file started with an empty line.


(rillig)
diff -r1.6 -r1.7 pkgsrc/pkgtools/check-portability/Makefile
diff -r1.9 -r1.10 pkgsrc/pkgtools/check-portability/files/check-portability.c
diff -r0 -r1.1 pkgsrc/pkgtools/check-portability/files/testdata/empty-line

cvs diff -r1.6 -r1.7 pkgsrc/pkgtools/check-portability/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/check-portability/Makefile 2020/03/13 16:20:34 1.6
+++ pkgsrc/pkgtools/check-portability/Makefile 2020/03/14 09:18:49 1.7
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.6 2020/03/13 16:20:34 rillig Exp $ 1# $NetBSD: Makefile,v 1.7 2020/03/14 09:18:49 rillig Exp $
2 2
3PKGNAME= check-portability-19.4.2 3PKGNAME= check-portability-19.4.3
4CATEGORIES= pkgtools 4CATEGORIES= pkgtools
5DISTFILES= # none 5DISTFILES= # none
6 6
7MAINTAINER= rillig@NetBSD.org 7MAINTAINER= rillig@NetBSD.org
8HOMEPAGE= # none 8HOMEPAGE= # none
9COMMENT= Check extracted files for typical portability issues 9COMMENT= Check extracted files for typical portability issues
10LICENSE= 2-clause-bsd 10LICENSE= 2-clause-bsd
11 11
12USE_TOOLS+= cp 12USE_TOOLS+= cp
13CHECK_PORTABILITY_SKIP= * # avoid circular dependency 13CHECK_PORTABILITY_SKIP= * # avoid circular dependency
14CHECK_PERMS_SKIP= * # avoid circular dependency 14CHECK_PERMS_SKIP= * # avoid circular dependency
15USE_LANGUAGES= c99 15USE_LANGUAGES= c99
16USE_BSD_MAKEFILE= yes 16USE_BSD_MAKEFILE= yes

cvs diff -r1.9 -r1.10 pkgsrc/pkgtools/check-portability/files/check-portability.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/check-portability/files/check-portability.c 2020/03/13 16:43:05 1.9
+++ pkgsrc/pkgtools/check-portability/files/check-portability.c 2020/03/14 09:18:49 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: check-portability.c,v 1.9 2020/03/13 16:43:05 rillig Exp $ */ 1/* $NetBSD: check-portability.c,v 1.10 2020/03/14 09:18:49 rillig Exp $ */
2 2
3/* 3/*
4 Copyright (c) 2020 Roland Illig 4 Copyright (c) 2020 Roland Illig
5 All rights reserved. 5 All rights reserved.
6 6
7 Redistribution and use in source and binary forms, with or without 7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions 8 modification, are permitted provided that the following conditions
9 are met: 9 are met:
10 10
11 1. Redistributions of source code must retain the above copyright 11 1. Redistributions of source code must retain the above copyright
12 notice, this list of conditions and the following disclaimer. 12 notice, this list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright 13 2. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the 14 notice, this list of conditions and the following disclaimer in the
@@ -161,28 +161,27 @@ cstr_right_of_last(cstr s, cstr delimite @@ -161,28 +161,27 @@ cstr_right_of_last(cstr s, cstr delimite
161 161
162// str is a modifiable string buffer. 162// str is a modifiable string buffer.
163typedef struct { 163typedef struct {
164 char *data; 164 char *data;
165 size_t len; 165 size_t len;
166 size_t cap; 166 size_t cap;
167} str; 167} str;
168 168
169#define STR_EMPTY { nullptr, 0, 0 } 169#define STR_EMPTY { nullptr, 0, 0 }
170 170
171static cstr 171static cstr
172str_c(str *s) 172str_c(str *s)
173{ 173{
174 assert(s->data != nullptr); 174 return (cstr) { s->data == nullptr ? "" : s->data, s->len };
175 return (cstr) { s->data, s->len }; 
176} 175}
177 176
178static void 177static void
179str_free(str *s) 178str_free(str *s)
180{ 179{
181 free(s->data); 180 free(s->data);
182} 181}
183 182
184static void 183static void
185str_reserve(str *s, size_t n) 184str_reserve(str *s, size_t n)
186{ 185{
187 size_t req_len = s->len + n; 186 size_t req_len = s->len + n;
188 assert(req_len >= s->len); 187 assert(req_len >= s->len);

File Added: pkgsrc/pkgtools/check-portability/files/testdata/empty-line

On 2020-03-14, check-portability crashed on files that started with an
empty line. This file ensures that this doesn't happen again.