oops, fix botched import

This commit is contained in:
robert 2021-12-12 11:35:08 +00:00
parent 07ce55ef25
commit d550de30a8
8 changed files with 0 additions and 164 deletions

View File

@ -1,22 +0,0 @@
# $OpenBSD: Makefile,v 1.1.1.1 2021/12/12 11:26:44 robert Exp $
COMMENT = traditional (K&R-style) C preprocessor
V = 0.5.3
DISTNAME = tradcpp-${V}
CATEGORIES = devel
HOMEPAGE = https://www.netbsd.org/~dholland/tradcpp/
MASTER_SITES = https://ftp.NetBSD.org/pub/NetBSD/misc/dholland/
# BSD
PERMIT_PACKAGE = Yes
# uses pledge()
WANTLIB = c
MAKE_FLAGS = BINDIR=${PREFIX}/bin MANDIR=${PREFIX}/man/man
NO_TEST = Yes
.include <bsd.port.mk>

View File

@ -1,2 +0,0 @@
SHA256 (tradcpp-0.5.3.tar.gz) = 4XufQs90s2DVaRvFn7U/N+QVgcRbdfzWS7ll5eL+TF4=
SIZE (tradcpp-0.5.3.tar.gz) = 38683

View File

@ -1,27 +0,0 @@
$OpenBSD: patch-files_c,v 1.1.1.1 2021/12/12 11:26:44 robert Exp $
Index: files.c
--- files.c.orig
+++ files.c
@@ -334,11 +334,7 @@ mkfilename(struct place *place, const char *dir, const
rlen = dlen + (needslash ? 1 : 0) + flen;
ret = domalloc(rlen + 1);
- strcpy(ret, dir);
- if (needslash) {
- strcat(ret, "/");
- }
- strcat(ret, file);
+ snprintf(ret, rlen+1, "%s%s%s", dir, needslash ? "/" : "", file);
return ret;
}
@@ -351,7 +347,7 @@ file_tryopen(const char *file)
/* XXX check for non-regular files */
fd = open(file, O_RDONLY);
- if (fd < 0) {
+ if (fd == -1) {
if (errno != ENOENT && errno != ENOTDIR) {
complain(NULL, "%s: %s", file, strerror(errno));
}

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-macro_c,v 1.1.1.1 2021/12/12 11:26:44 robert Exp $
Index: macro.c
--- macro.c.orig
+++ macro.c
@@ -850,20 +850,20 @@ expand_substitute(struct place *p, struct expstate *es
ei = expansionitemarray_get(&es->curmacro->expansion, i);
switch (ei->itemtype) {
case EI_STRING:
- strcat(ret, ei->ei_string);
+ strlcat(ret, ei->ei_string, len + 1);
break;
case EI_PARAM:
arg = stringarray_get(&es->args, ei->ei_param);
- strcat(ret, arg);
+ strlcat(ret, arg, len + 1);
break;
case EI_FILE:
- strcat(ret, "\"");
- strcat(ret, place_getname(p));
- strcat(ret, "\"");
+ strlcat(ret, "\"", len + 1);
+ strlcat(ret, place_getname(p), len + 1);
+ strlcat(ret, "\"", len + 1);
break;
case EI_LINE:
snprintf(numbuf, sizeof(numbuf), "%u", p->line);
- strcat(ret, numbuf);
+ strlcat(ret, numbuf, len + 1);
break;
}
}

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-main_c,v 1.1.1.1 2021/12/12 11:26:44 robert Exp $
Index: main.c
--- main.c.orig
+++ main.c
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <errno.h>
@@ -1053,6 +1054,11 @@ main(int argc, char *argv[])
progname = strrchr(argv[0], '/');
progname = progname == NULL ? argv[0] : progname + 1;
complain_init(progname);
+
+ if (pledge("stdio rpath wpath cpath", NULL) == -1) {
+ fprintf(stderr, "%s: pledge: %s", progname, strerror(errno));
+ exit(1);
+ }
init();

View File

@ -1,43 +0,0 @@
$OpenBSD: patch-utils_c,v 1.1.1.1 2021/12/12 11:26:44 robert Exp $
Index: utils.c
--- utils.c.orig
+++ utils.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
#include <assert.h>
#include "utils.h"
@@ -170,7 +171,7 @@ dostrdup(const char *s)
len = strlen(s);
ret = domalloc(len+1);
- strcpy(ret, s);
+ strlcpy(ret, s, len+1);
return ret;
}
@@ -182,8 +183,7 @@ dostrdup2(const char *s, const char *t)
len = strlen(s) + strlen(t);
ret = domalloc(len+1);
- strcpy(ret, s);
- strcat(ret, t);
+ snprintf(ret, len+1, "%s%s", s, t);
return ret;
}
@@ -195,9 +195,7 @@ dostrdup3(const char *s, const char *t, const char *u)
len = strlen(s) + strlen(t) + strlen(u);
ret = domalloc(len+1);
- strcpy(ret, s);
- strcat(ret, t);
- strcat(ret, u);
+ snprintf(ret, len+1, "%s%s%s", s, t, u);
return ret;
}

View File

@ -1,10 +0,0 @@
tradcpp is a K&R-style ("traditional") C preprocessor. It was written to
support historical uses of the C preprocessor for preprocessing things that
aren't C, as the preprocessors that ship with C compilers are increasingly
unsuitable for this task and/or don't provide a traditional mode at all.
In particular, tradcpp preserves whitespace as much as possible, so it can be
used in contexts where whitespace is significant and/or rearranging whitespace
causes things to break, such as makefiles. Preprocessing makefiles with cpp is
a fairly common property of sufficiently old legacy build systems, including
old versions of Emacs and anything that uses imake.

View File

@ -1,3 +0,0 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2021/12/12 11:26:44 robert Exp $
@bin bin/tradcpp
@man man/man1/tradcpp.1