Module Name: src Committed By: rillig Date: Thu Aug 19 16:15:31 UTC 2021
Modified Files: src/usr.bin/xlint/xlint: xlint.c Log Message: lint: simplify code for adding '-l' and '-L' to libraries No functional change. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/usr.bin/xlint/xlint/xlint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/xlint/xlint.c diff -u src/usr.bin/xlint/xlint/xlint.c:1.74 src/usr.bin/xlint/xlint/xlint.c:1.75 --- src/usr.bin/xlint/xlint/xlint.c:1.74 Thu Aug 19 16:05:56 2021 +++ src/usr.bin/xlint/xlint/xlint.c Thu Aug 19 16:15:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xlint.c,v 1.74 2021/08/19 16:05:56 rillig Exp $ */ +/* $NetBSD: xlint.c,v 1.75 2021/08/19 16:15:31 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: xlint.c,v 1.74 2021/08/19 16:05:56 rillig Exp $"); +__RCSID("$NetBSD: xlint.c,v 1.75 2021/08/19 16:15:31 rillig Exp $"); #endif #include <sys/param.h> @@ -554,22 +554,16 @@ main(int argc, char *argv[]) if (arg[0] == '-') { char ***list; - list = NULL; /* XXXGCC -Wuninitialized */ - /* option */ - switch (arg[1]) { - case 'l': + if (arg[1] == 'l') list = &libs; - break; - - case 'L': + else if (arg[1] == 'L') list = &libsrchpath; - break; - - default: + else { usage(); /* NOTREACHED */ } + if (arg[2] != '\0') list_add_copy(list, arg + 2); else if (argc > 1) {