am b303cdc2: am 9d586d85: am 6916166e: Merge "Sync with upstream OpenBSD."

* commit 'b303cdc2c18a28becb2be5b5394dc599022f7ace':
  Sync with upstream OpenBSD.
This commit is contained in:
Elliott Hughes 2014-05-05 22:18:03 +00:00 committed by Android Git Automerger
commit 2a0d2202ef
4 changed files with 22 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: fnmatch.c,v 1.16 2011/12/06 11:47:46 stsp Exp $ */
/* $OpenBSD: fnmatch.c,v 1.17 2013/11/24 23:51:29 deraadt Exp $ */
/* Copyright (c) 2011, VMware, Inc.
* All rights reserved.
@ -214,10 +214,13 @@ leadingclosebrace:
/* XXX: handle locale/MBCS comparison, advance by MBCS char width */
if ((**string >= *startch) && (**string <= **pattern))
result = 0;
else if (nocase && (isupper(**string) || isupper(*startch)
|| isupper(**pattern))
&& (tolower(**string) >= tolower(*startch))
&& (tolower(**string) <= tolower(**pattern)))
else if (nocase && (isupper((unsigned char)**string) ||
isupper((unsigned char)*startch) ||
isupper((unsigned char)**pattern))
&& (tolower((unsigned char)**string) >=
tolower((unsigned char)*startch))
&& (tolower((unsigned char)**string) <=
tolower((unsigned char)**pattern)))
result = 0;
++*pattern;
@ -227,8 +230,10 @@ leadingclosebrace:
/* XXX: handle locale/MBCS comparison, advance by MBCS char width */
if ((**string == **pattern))
result = 0;
else if (nocase && (isupper(**string) || isupper(**pattern))
&& (tolower(**string) == tolower(**pattern)))
else if (nocase && (isupper((unsigned char)**string) ||
isupper((unsigned char)**pattern))
&& (tolower((unsigned char)**string) ==
tolower((unsigned char)**pattern)))
result = 0;
++*pattern;
@ -254,8 +259,10 @@ leadingclosebrace:
/* XXX: handle locale/MBCS comparison, advance by the MBCS char width */
if (**string == **pattern)
result = 0;
else if (nocase && (isupper(**string) || isupper(**pattern))
&& (tolower(**string) == tolower(**pattern)))
else if (nocase && (isupper((unsigned char)**string) ||
isupper((unsigned char)**pattern))
&& (tolower((unsigned char)**string) ==
tolower((unsigned char)**pattern)))
result = 0;
/* Refuse to advance over trailing slash or nulls

View File

@ -1,4 +1,4 @@
/* $OpenBSD: getprogname.c,v 1.2 2013/05/31 21:19:01 tedu Exp $ */
/* $OpenBSD: getprogname.c,v 1.3 2013/11/12 06:09:48 deraadt Exp $ */
/*
* Copyright (c) 2013 Antoine Jacoutot <ajacoutot@openbsd.org>
*
@ -15,6 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <stdlib.h>
extern const char *__progname;
const char *

View File

@ -1,4 +1,4 @@
/* $OpenBSD: setprogname.c,v 1.3 2013/06/01 01:43:43 tedu Exp $ */
/* $OpenBSD: setprogname.c,v 1.4 2013/11/12 06:09:48 deraadt Exp $ */
/*
* Copyright (c) 2013 Antoine Jacoutot <ajacoutot@openbsd.org>
*
@ -16,6 +16,7 @@
*/
#include <string.h>
#include <stdlib.h>
extern const char *__progname;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: strsep.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strsep.c,v 1.7 2014/02/05 20:42:32 stsp Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -30,7 +30,6 @@
*/
#include <string.h>
#include <stdio.h>
/*
* Get next token from string *stringp, where tokens are possibly-empty