From c2c4f740efb53d8e3a2c87779660764a71a49dc0 Mon Sep 17 00:00:00 2001 From: Stefan Kempf Date: Sat, 10 Nov 2007 22:11:23 +0000 Subject: Pull from master repo: Get rid of ifdef'd out code. Replace nodup() call with equivalent code at its only invocation. ok ragge@, otto@ --- usr.bin/pcc/cc/cc.c | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) (limited to 'usr.bin/pcc/cc') diff --git a/usr.bin/pcc/cc/cc.c b/usr.bin/pcc/cc/cc.c index d4648524640..6f5d153fffc 100644 --- a/usr.bin/pcc/cc/cc.c +++ b/usr.bin/pcc/cc/cc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cc.c,v 1.10 2007/11/02 21:07:52 millert Exp $ */ +/* $OpenBSD: cc.c,v 1.11 2007/11/10 22:11:22 stefan Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -85,7 +85,6 @@ int getsuf(char *); int main(int, char *[]); void error(char *, ...); void errorx(int, char *, ...); -int nodup(char **, char *); int callsys(char [], char *[]); int cunlink(char *); void dexit(int); @@ -341,7 +340,13 @@ main(int argc, char *argv[]) } t = setsuf(t, 'o'); } - if (nodup(llist, t)) { + + /* Check for duplicate .o files. */ + for (j = getsuf(t) == 'o' ? 0 : nl; j < nl; j++) { + if (strcmp(llist[j], t) == 0) + break; + } + if (j == nl) { llist[nl++] = t; if (nl >= MAXLIB) { @@ -360,17 +365,6 @@ main(int argc, char *argv[]) errorx(8, "-o given with -c || -E || -S and more than one file"); if (outfile && clist[0] && strcmp(outfile, clist[0]) == 0) errorx(8, "output file will be clobbered"); -#if 0 - for(i=0, j=0; i