From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2B7EA1381F3 for ; Sun, 4 Nov 2012 06:55:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E659021C010; Sun, 4 Nov 2012 06:55:06 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4590B21C010 for ; Sun, 4 Nov 2012 06:55:06 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 88F7733D813 for ; Sun, 4 Nov 2012 06:55:05 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id 53BBA215F3; Sun, 4 Nov 2012 06:55:04 +0000 (UTC) From: "Mike Frysinger (vapier)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, vapier@gentoo.org Subject: [gentoo-commits] gentoo-projects commit in pax-utils: scanelf.c X-VCS-Repository: gentoo-projects X-VCS-Files: scanelf.c X-VCS-Directories: pax-utils X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20121104065504.53BBA215F3@flycatcher.gentoo.org> Date: Sun, 4 Nov 2012 06:55:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 826118cb-2886-4c42-9e2a-1588de0fa48a X-Archives-Hash: aec105d3919d015f432555091b6711da vapier 12/11/04 06:55:04 Modified: scanelf.c Log: scanelf: if people use -g twice, switch to case insensitive regexes #433425 Revision Changes Path 1.246 pax-utils/scanelf.c file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/scanelf.c?rev=1.246&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/scanelf.c?rev=1.246&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/scanelf.c?r1=1.245&r2=1.246 Index: scanelf.c =================================================================== RCS file: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v retrieving revision 1.245 retrieving revision 1.246 diff -u -r1.245 -r1.246 --- scanelf.c 4 Aug 2012 06:08:25 -0000 1.245 +++ scanelf.c 4 Nov 2012 06:55:04 -0000 1.246 @@ -1,13 +1,13 @@ /* * Copyright 2003-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.245 2012/08/04 06:08:25 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.246 2012/11/04 06:55:04 vapier Exp $ * * Copyright 2003-2007 Ned Ludd - * Copyright 2004-2007 Mike Frysinger - */ -static const char rcsid[] = "$Id: scanelf.c,v 1.245 2012/08/04 06:08:25 vapier Exp $"; +static const char rcsid[] = "$Id: scanelf.c,v 1.246 2012/11/04 06:55:04 vapier Exp $"; const char argv0[] = "scanelf"; #include "paxinc.h" @@ -127,14 +127,11 @@ if ((match == NULL) || (regex == NULL)) return EXIT_FAILURE; - if ((ret = regcomp(&preg, regex, cflags))) { + ret = regcomp(&preg, regex, cflags); + if (ret) { char err[256]; - - if (regerror(ret, &preg, err, sizeof(err))) - fprintf(stderr, "regcomp failed: %s", err); - else - fprintf(stderr, "regcomp failed"); - + regerror(ret, &preg, err, sizeof(err)); + warnf("regcomp failed: %s", err); return EXIT_FAILURE; } ret = regexec(&preg, match, 0, NULL, 0); @@ -1272,7 +1269,10 @@ } else { if (g_match) { /* regex match the symbol */ - if (rematch(this_sym, symname, REG_EXTENDED) != 0) + int flags = REG_EXTENDED | REG_NOSUB; + if (g_match > 1) + flags |= REG_ICASE; + if (rematch(this_sym, symname, flags) != 0) continue; } else if (*this_sym) { @@ -2026,7 +2026,7 @@ "Find a specified symbol", "Find a specified section", "Find a specified library", - "Use regex matching rather than string compare (use with -s)", + "Use regex rather than string compare (with -s); specify twice for case insensitive", "Locate cause of TEXTREL", "Print only ELF files matching etype ET_DYN,ET_EXEC ...", "Print only ELF files matching numeric bits", @@ -2188,7 +2188,7 @@ break; } case 'Z': show_size = 1; break; - case 'g': g_match = 1; break; + case 'g': ++g_match; break; case 'L': load_cache_config = use_ldcache = 1; break; case 'y': scan_symlink = 0; break; case 'A': scan_archives = 1; break;