Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/prg-localcount2]: src Sync with HEAD - tag prg-localcount2-base1
details: https://anonhg.NetBSD.org/src/rev/8f1fd6e4bca8
branches: prg-localcount2
changeset: 823533:8f1fd6e4bca8
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Tue May 02 03:19:14 2017 +0000
description:
Sync with HEAD - tag prg-localcount2-base1
diffstat:
bin/csh/glob.c | 100 +-
bin/ksh/misc.c | 90 +-
bin/sh/expand.c | 117 +-
bin/sh/expand.h | 3 +-
bin/sh/input.c | 29 +-
bin/sh/jobs.c | 35 +-
bin/sh/redir.c | 115 +-
bin/sh/redir.h | 4 +-
bin/sh/sh.1 | 40 +-
bin/sh/trap.c | 66 +-
bin/sh/var.c | 8 +-
distrib/sets/lists/comp/mi | 29 +-
distrib/sets/lists/tests/mi | 4 +-
doc/3RDPARTY | 8 +-
doc/BRANCHES | 23 +-
doc/CHANGES | 4 +-
external/bsd/acpica/bin/iasl/Makefile | 8 +-
external/mit/lua/dist/Makefile | 2 +-
external/mit/lua/dist/README | 2 +-
external/mit/lua/dist/doc/contents.html | 7 +-
external/mit/lua/dist/doc/logo.gif | Bin
external/mit/lua/dist/doc/lua.1 | 5 +-
external/mit/lua/dist/doc/luac.1 | 2 +-
external/mit/lua/dist/doc/manual.html | 281 +-
external/mit/lua/dist/doc/readme.html | 6 +-
external/mit/lua/dist/src/lapi.c | 2 +-
external/mit/lua/dist/src/lapi.h | 2 +-
external/mit/lua/dist/src/lauxlib.c | 54 +-
external/mit/lua/dist/src/lauxlib.h | 14 +-
external/mit/lua/dist/src/lbaselib.c | 6 +-
external/mit/lua/dist/src/lbitlib.c | 2 +-
external/mit/lua/dist/src/lcode.c | 20 +-
external/mit/lua/dist/src/lcode.h | 2 +-
external/mit/lua/dist/src/lcorolib.c | 2 +-
external/mit/lua/dist/src/lctype.c | 2 +-
external/mit/lua/dist/src/lctype.h | 2 +-
external/mit/lua/dist/src/ldblib.c | 2 +-
external/mit/lua/dist/src/ldebug.c | 47 +-
external/mit/lua/dist/src/ldebug.h | 2 +-
external/mit/lua/dist/src/ldo.c | 228 +-
external/mit/lua/dist/src/ldo.h | 2 +-
external/mit/lua/dist/src/ldump.c | 2 +-
external/mit/lua/dist/src/lfunc.c | 2 +-
external/mit/lua/dist/src/lfunc.h | 2 +-
external/mit/lua/dist/src/lgc.c | 10 +-
external/mit/lua/dist/src/lgc.h | 2 +-
external/mit/lua/dist/src/linit.c | 8 +-
external/mit/lua/dist/src/liolib.c | 19 +-
external/mit/lua/dist/src/llex.c | 2 +-
external/mit/lua/dist/src/llex.h | 2 +-
external/mit/lua/dist/src/llimits.h | 2 +-
external/mit/lua/dist/src/lmathlib.c | 19 +-
external/mit/lua/dist/src/lmem.c | 2 +-
external/mit/lua/dist/src/lmem.h | 2 +-
external/mit/lua/dist/src/loadlib.c | 171 +-
external/mit/lua/dist/src/lobject.c | 8 +-
external/mit/lua/dist/src/lobject.h | 6 +-
external/mit/lua/dist/src/lopcodes.c | 2 +-
external/mit/lua/dist/src/lopcodes.h | 6 +-
external/mit/lua/dist/src/loslib.c | 31 +-
external/mit/lua/dist/src/lparser.c | 9 +-
external/mit/lua/dist/src/lparser.h | 2 +-
external/mit/lua/dist/src/lprefix.h | 2 +-
external/mit/lua/dist/src/lstate.c | 2 +-
external/mit/lua/dist/src/lstate.h | 13 +-
external/mit/lua/dist/src/lstring.c | 2 +-
external/mit/lua/dist/src/lstring.h | 2 +-
external/mit/lua/dist/src/lstrlib.c | 22 +-
external/mit/lua/dist/src/ltable.c | 48 +-
external/mit/lua/dist/src/ltable.h | 16 +-
external/mit/lua/dist/src/ltablib.c | 2 +-
external/mit/lua/dist/src/ltm.c | 6 +-
external/mit/lua/dist/src/ltm.h | 2 +-
external/mit/lua/dist/src/lua.c | 15 +-
external/mit/lua/dist/src/lua.h | 16 +-
external/mit/lua/dist/src/luac.c | 2 +-
external/mit/lua/dist/src/luaconf.h | 36 +-
external/mit/lua/dist/src/lualib.h | 7 +-
external/mit/lua/dist/src/lundump.c | 2 +-
external/mit/lua/dist/src/lundump.h | 2 +-
external/mit/lua/dist/src/lutf8lib.c | 6 +-
external/mit/lua/dist/src/lvm.c | 2 +-
external/mit/lua/dist/src/lvm.h | 6 +-
external/mit/lua/dist/src/lzio.c | 2 +-
external/mit/lua/dist/src/lzio.h | 2 +-
lib/libc/gen/glob.c | 65 +-
lib/libterminfo/termcap.c | 8 +-
lib/libterminfo/tputs.c | 6 +-
libexec/ld.elf_so/reloc.c | 20 +-
sbin/fsck_msdos/dir.c | 6 +-
sbin/nvmectl/Makefile | 3 +-
sbin/nvmectl/firmware.c | 8 +-
sbin/nvmectl/logpage.c | 773 ++-
sbin/nvmectl/nvme.h | 38 +-
sbin/nvmectl/nvmectl.8 | 73 +-
sbin/nvmectl/nvmectl.c | 53 +-
sbin/nvmectl/nvmectl.h | 31 +-
sbin/nvmectl/wdc.c | 354 +
share/man/man4/midi.4 | 7 +-
share/man/man4/nvme.4 | 18 +-
share/man/man8/compat_freebsd.8 | 17 +-
share/man/man9/Makefile | 5 +-
share/man/man9/devsw_attach.9 | 7 +-
share/man/man9/driver.9 | 5 +-
share/man/man9/mutex.9 | 5 +-
sys/arch/amd64/conf/ALL | 172 +-
sys/arch/arm/nvidia/files.tegra | 8 +-
sys/arch/arm/nvidia/tegra124_car.c | 5 +-
sys/arch/arm/nvidia/tegra124_cpu.c | 22 +-
sys/arch/arm/nvidia/tegra_apbdma.c | 487 +
sys/arch/arm/nvidia/tegra_apbdmareg.h | 111 +
sys/arch/arm/nvidia/tegra_xusb.c | 175 +-
sys/arch/evbarm/conf/TEGRA | 5 +-
sys/arch/i386/stand/efiboot/Makefile.efiboot | 4 +-
sys/arch/i386/stand/efiboot/boot.c | 74 +-
sys/arch/i386/stand/efiboot/bootia32/efibootia32.c | 4 +-
sys/arch/i386/stand/efiboot/bootia32/start.S | 18 +-
sys/arch/i386/stand/efiboot/bootx64/efibootx64.c | 4 +-
sys/arch/i386/stand/efiboot/bootx64/start.S | 18 +-
sys/arch/i386/stand/efiboot/efiboot.h | 3 +-
sys/arch/i386/stand/efiboot/eficons.c | 72 +-
sys/arch/mips/mips/cache_r4k_subr.S | 4 +-
sys/arch/mips/mips/cache_r5k.c | 6 +-
sys/arch/next68k/dev/zs.c | 6 +-
sys/arch/sparc/stand/boot/Makefile | 11 +-
sys/arch/sparc64/dev/ffb.c | 63 +-
sys/arch/x86/include/i82489reg.h | 3 +-
sys/compat/common/vm_43.c | 17 +-
sys/compat/linux32/arch/amd64/linux32_exec.h | 8 +-
sys/compat/netbsd32/netbsd32_netbsd.c | 11 +-
sys/compat/sys/mman.h | 8 +-
sys/dev/audio.c | 143 +-
sys/dev/dksubr.c | 21 +-
sys/dev/dkvar.h | 3 +-
sys/dev/fdt/fdt_dma.c | 190 +
sys/dev/fdt/fdt_subr.c | 16 +-
sys/dev/fdt/fdtbus.c | 52 +-
sys/dev/fdt/fdtvar.h | 61 +-
sys/dev/fdt/files.fdt | 3 +-
sys/dev/i2c/as3722.c | 147 +-
sys/dev/ic/ld_nvme.c | 6 +-
sys/dev/isa/tpm_isa.c | 9 +-
sys/dev/ld.c | 7 +-
sys/dev/ldvar.h | 3 +-
sys/dev/ofw/ofw_subr.c | 9 +-
sys/dev/ofw/openfirm.h | 5 +-
sys/dev/pci/com_puc.c | 11 +-
sys/dev/pci/hdaudio_pci.c | 8 +-
sys/dev/pci/if_bge.c | 8 +-
sys/dev/pci/if_re_pci.c | 7 +-
sys/dev/pci/ismt.c | 6 +-
sys/dev/pci/ixgbe/ixgbe.c | 4 +-
sys/dev/pci/lpt_puc.c | 11 +-
sys/dev/pci/pci_subr.c | 5 +-
sys/dev/pci/pcidevs | 18 +-
sys/dev/pci/pcidevs.h | 20 +-
sys/dev/pci/pcidevs_data.h | 3554 ++++++-----
sys/dev/pci/ppb.c | 57 +-
sys/dev/pci/sdhc_pci.c | 7 +-
sys/dev/pci/uhci_pci.c | 7 +-
sys/dev/wscons/wsdisplay_vcons.c | 11 +-
sys/external/bsd/acpica/dist/changes.txt | 103 +-
sys/external/bsd/acpica/dist/common/adisasm.c | 39 +-
sys/external/bsd/acpica/dist/common/adwalk.c | 2 +-
sys/external/bsd/acpica/dist/common/dmextern.c | 25 +
sys/external/bsd/acpica/dist/common/dmrestag.c | 6 +-
sys/external/bsd/acpica/dist/common/dmtables.c | 22 +
sys/external/bsd/acpica/dist/common/dmtbinfo.c | 10 +-
sys/external/bsd/acpica/dist/compiler/aslcodegen.c | 101 +-
sys/external/bsd/acpica/dist/compiler/aslcompile.c | 31 +-
sys/external/bsd/acpica/dist/compiler/aslcompiler.h | 16 +
sys/external/bsd/acpica/dist/compiler/aslcompiler.l | 5 +-
sys/external/bsd/acpica/dist/compiler/asldebug.c | 34 +
sys/external/bsd/acpica/dist/compiler/asldefine.h | 8 +-
sys/external/bsd/acpica/dist/compiler/aslfiles.c | 32 +-
sys/external/bsd/acpica/dist/compiler/aslglobal.h | 22 +-
sys/external/bsd/acpica/dist/compiler/aslhelp.c | 8 +-
sys/external/bsd/acpica/dist/compiler/asllength.c | 5 +-
sys/external/bsd/acpica/dist/compiler/aslmap.c | 36 +-
sys/external/bsd/acpica/dist/compiler/asloffset.c | 2 +-
sys/external/bsd/acpica/dist/compiler/asloperands.c | 7 +-
sys/external/bsd/acpica/dist/compiler/asloptions.c | 63 +-
sys/external/bsd/acpica/dist/compiler/aslprimaries.y | 23 +-
sys/external/bsd/acpica/dist/compiler/aslprintf.c | 2 +-
sys/external/bsd/acpica/dist/compiler/aslresources.y | 9 +-
sys/external/bsd/acpica/dist/compiler/aslrules.y | 10 +-
sys/external/bsd/acpica/dist/compiler/aslstartup.c | 32 +
sys/external/bsd/acpica/dist/compiler/aslsupport.l | 114 +-
sys/external/bsd/acpica/dist/compiler/asltree.c | 175 +-
sys/external/bsd/acpica/dist/compiler/asltypes.h | 22 +-
sys/external/bsd/acpica/dist/compiler/aslwalks.c | 2 +-
sys/external/bsd/acpica/dist/compiler/cvcompiler.c | 890 +++
sys/external/bsd/acpica/dist/compiler/cvdisasm.c | 423 +
sys/external/bsd/acpica/dist/compiler/cvparser.c | 887 ++
sys/external/bsd/acpica/dist/compiler/dttable1.c | 4 +
sys/external/bsd/acpica/dist/compiler/dttemplate.h | 72 +-
sys/external/bsd/acpica/dist/debugger/dbmethod.c | 1 +
sys/external/bsd/acpica/dist/debugger/dbxface.c | 5 +-
sys/external/bsd/acpica/dist/disassembler/dmcstyle.c | 51 +-
sys/external/bsd/acpica/dist/disassembler/dmdeferred.c | 6 +-
sys/external/bsd/acpica/dist/disassembler/dmnames.c | 2 +-
sys/external/bsd/acpica/dist/disassembler/dmopcode.c | 85 +-
sys/external/bsd/acpica/dist/disassembler/dmutils.c | 8 +
sys/external/bsd/acpica/dist/disassembler/dmwalk.c | 105 +-
sys/external/bsd/acpica/dist/dispatcher/dscontrol.c | 2 +-
sys/external/bsd/acpica/dist/dispatcher/dsmthdat.c | 3 +-
sys/external/bsd/acpica/dist/dispatcher/dsobject.c | 14 +-
sys/external/bsd/acpica/dist/dispatcher/dsopcode.c | 4 +-
sys/external/bsd/acpica/dist/dispatcher/dsutils.c | 6 +-
sys/external/bsd/acpica/dist/dispatcher/dswexec.c | 2 +-
sys/external/bsd/acpica/dist/dispatcher/dswload2.c | 2 +-
sys/external/bsd/acpica/dist/executer/exmisc.c | 16 +-
sys/external/bsd/acpica/dist/executer/exnames.c | 4 +-
sys/external/bsd/acpica/dist/executer/exoparg1.c | 15 +-
sys/external/bsd/acpica/dist/executer/exoparg2.c | 4 +-
sys/external/bsd/acpica/dist/executer/exoparg6.c | 10 +-
sys/external/bsd/acpica/dist/executer/exresolv.c | 2 +-
sys/external/bsd/acpica/dist/executer/exstore.c | 4 +-
sys/external/bsd/acpica/dist/executer/exstoren.c | 2 +-
sys/external/bsd/acpica/dist/generate/unix/Makefile.config | 9 +
sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile | 3 +
sys/external/bsd/acpica/dist/hardware/hwvalid.c | 18 +-
sys/external/bsd/acpica/dist/include/acconfig.h | 1 +
sys/external/bsd/acpica/dist/include/acconvert.h | 204 +
sys/external/bsd/acpica/dist/include/acdisasm.h | 14 +
sys/external/bsd/acpica/dist/include/acglobal.h | 44 +
sys/external/bsd/acpica/dist/include/aclocal.h | 118 +-
sys/external/bsd/acpica/dist/include/acmacros.h | 35 +
sys/external/bsd/acpica/dist/include/acopcode.h | 2 +
sys/external/bsd/acpica/dist/include/acpixf.h | 2 +-
sys/external/bsd/acpica/dist/include/actbl2.h | 11 +
sys/external/bsd/acpica/dist/include/amlcode.h | 104 +-
sys/external/bsd/acpica/dist/namespace/nsaccess.c | 2 +-
sys/external/bsd/acpica/dist/namespace/nsrepair.c | 16 +-
sys/external/bsd/acpica/dist/namespace/nsrepair2.c | 6 +-
sys/external/bsd/acpica/dist/namespace/nsutils.c | 31 +-
sys/external/bsd/acpica/dist/parser/psargs.c | 30 +-
sys/external/bsd/acpica/dist/parser/psloop.c | 39 +-
sys/external/bsd/acpica/dist/parser/psobject.c | 36 +
sys/external/bsd/acpica/dist/parser/psopcode.c | 13 +-
sys/external/bsd/acpica/dist/parser/psopinfo.c | 2 +-
sys/external/bsd/acpica/dist/parser/psparse.c | 6 +-
sys/external/bsd/acpica/dist/parser/pstree.c | 9 +-
sys/external/bsd/acpica/dist/parser/psutils.c | 13 +
sys/external/bsd/acpica/dist/tools/acpisrc/acpisrc.h | 2 +-
sys/external/bsd/acpica/dist/tools/acpisrc/astable.c | 2 +
sys/external/bsd/acpica/dist/utilities/utalloc.c | 44 +
sys/external/bsd/acpica/dist/utilities/utcache.c | 2 +-
sys/external/bsd/acpica/dist/utilities/utdebug.c | 1 +
sys/external/bsd/acpica/dist/utilities/utresrc.c | 10 +
sys/external/bsd/acpica/dist/utilities/utxferror.c | 16 +-
sys/kern/kern_event.c | 32 +-
sys/kern/kern_mutex.c | 16 +-
sys/kern/subr_localcount.c | 6 +-
sys/kern/subr_lockdebug.c | 12 +-
sys/kern/uipc_socket.c | 47 +-
sys/netinet/in.c | 20 +-
sys/netinet6/in6.c | 22 +-
sys/netipsec/ipsec.c | 7 +-
sys/netipsec/keysock.c | 6 +-
sys/rump/librump/rumpkern/locks.c | 7 +-
sys/sys/bootblock.h | 3 +-
sys/sys/mman.h | 11 +-
sys/sys/mutex.h | 2 +-
sys/sys/param.h | 4 +-
sys/uvm/pmap/pmap.c | 8 +-
sys/uvm/uvm_mmap.c | 19 +-
tests/lib/libc/gen/t_glob.c | 67 +-
tests/lib/libc/stdlib/t_strtoi.c | 6 +-
tests/net/ipsec/Makefile | 6 +-
tests/net/ipsec/algorithms.sh | 4 +-
tests/net/ipsec/t_ipsec_gif.sh | 467 +
tests/net/ipsec/t_ipsec_l2tp.sh | 453 +
usr.bin/man/man.c | 8 +-
usr.bin/sortinfo/sortinfo.1 | 6 +-
usr.bin/sortinfo/sortinfo.c | 5 +-
usr.sbin/makemandb/apropos-utils.c | 113 +-
usr.sbin/makemandb/apropos-utils.h | 4 +-
usr.sbin/makemandb/apropos.c | 66 +-
usr.sbin/makemandb/makemandb.c | 49 +-
280 files changed, 11243 insertions(+), 3804 deletions(-)
diffs (truncated from 24762 to 300 lines):
diff -r 8bad2e7458ac -r 8f1fd6e4bca8 bin/csh/glob.c
--- a/bin/csh/glob.c Sun Apr 30 10:27:16 2017 +0000
+++ b/bin/csh/glob.c Tue May 02 03:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: glob.c,v 1.27 2013/07/16 17:47:43 christos Exp $ */
+/* $NetBSD: glob.c,v 1.27.18.1 2017/05/02 03:19:14 pgoyette Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)glob.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: glob.c,v 1.27 2013/07/16 17:47:43 christos Exp $");
+__RCSID("$NetBSD: glob.c,v 1.27.18.1 2017/05/02 03:19:14 pgoyette Exp $");
#endif
#endif /* not lint */
@@ -89,7 +89,7 @@
static Char **globexpand(Char **);
static int globbrace(Char *, Char *, Char ***);
static void expbrace(Char ***, Char ***, size_t);
-static int pmatch(Char *, Char *);
+static int pmatch(const Char *, const Char *);
static void pword(void);
static void psave(int);
static void backeval(Char *, int);
@@ -818,56 +818,74 @@
}
static int
-pmatch(Char *string, Char *pattern)
+pmatch(const Char *name, const Char *pat)
{
int match, negate_range;
- Char patternc, rangec, stringc;
+ Char patc, namec, c;
+ const Char *nameNext, *nameStart, *nameEnd, *patNext;
+
+ nameNext = nameStart = name;
+ patNext = pat;
+ nameEnd = NULL;
- for (;; ++string) {
- stringc = *string & TRIM;
- patternc = *pattern++;
- switch (patternc) {
+ for (;;) {
+ namec = *name & TRIM;
+ if (namec == 0)
+ nameEnd = name;
+ patc = *pat;
+ switch (patc) {
case 0:
- return (stringc == 0);
+ if (namec == 0)
+ return 1;
+ break;
case '?':
- if (stringc == 0)
- return (0);
- break;
+ if (namec == 0)
+ break;
+ pat++;
+ name++;
+ continue;
case '*':
- if (!*pattern)
- return (1);
- while (*string)
- if (Gmatch(string++, pattern))
- return (1);
- return (0);
+ while ((pat[1] & TRIM) == '*')
+ pat++;
+ patNext = pat;
+ nameNext = name + 1;
+ pat++;
+ continue;
case '[':
match = 0;
- if ((negate_range = (*pattern == '^')) != 0)
- pattern++;
- while ((rangec = *pattern++) != '\0') {
- if (rangec == ']')
- break;
- if (match)
- continue;
- if (rangec == '-' && *(pattern-2) != '[' && *pattern != ']') {
- match = (stringc <= (*pattern & TRIM) &&
- (*(pattern-2) & TRIM) <= stringc);
- pattern++;
- }
- else
- match = (stringc == (rangec & TRIM));
+ if (namec == 0)
+ break;
+ pat++;
+ name++;
+ if ((negate_range = (*pat == '^')) != 0)
+ pat++;
+ while ((c = *pat++) != ']') {
+ c &= TRIM;
+ if (*pat == '-') {
+ if (c <= namec && namec <= (pat[1] & TRIM))
+ match = 1;
+ pat += 2;
+ } else if (c == namec)
+ match = 1;
+ else if (c == 0)
+ stderror(ERR_NAME | ERR_MISSING, ']');
}
- if (rangec == 0)
- stderror(ERR_NAME | ERR_MISSING, ']');
if (match == negate_range)
- return (0);
- break;
+ break;
+ continue;
default:
- if ((patternc & TRIM) != stringc)
- return (0);
- break;
-
+ if ((patc & TRIM) != namec)
+ break;
+ pat++;
+ name++;
+ continue;
}
+ if (nameNext != nameStart && (nameEnd == NULL || nameNext <= nameEnd)) {
+ pat = patNext;
+ name = nameNext;
+ continue;
+ }
+ return 0;
}
}
diff -r 8bad2e7458ac -r 8f1fd6e4bca8 bin/ksh/misc.c
--- a/bin/ksh/misc.c Sun Apr 30 10:27:16 2017 +0000
+++ b/bin/ksh/misc.c Tue May 02 03:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.15 2011/10/16 17:12:11 joerg Exp $ */
+/* $NetBSD: misc.c,v 1.15.34.1 2017/05/02 03:19:14 pgoyette Exp $ */
/*
* Miscellaneous functions
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: misc.c,v 1.15 2011/10/16 17:12:11 joerg Exp $");
+__RCSID("$NetBSD: misc.c,v 1.15.34.1 2017/05/02 03:19:14 pgoyette Exp $");
#endif
@@ -631,46 +631,50 @@
const unsigned char *se, *pe;
int isfile;
{
- register int sc, pc;
+ int sc, pc;
const unsigned char *prest, *psub, *pnext;
const unsigned char *srest;
+ const unsigned char *sNext, *pNext, *sStart;
if (s == NULL || p == NULL)
return 0;
- while (p < pe) {
- pc = *p++;
+ sNext = sStart = s;
+ pNext = p;
+ while (p < pe || s < se) {
+ pc = *p;
sc = s < se ? *s : '\0';
- s++;
if (isfile) {
sc = FILECHCONV((unsigned char)sc);
pc = FILECHCONV((unsigned char)pc);
}
if (!ISMAGIC(pc)) {
if (sc != pc)
- return 0;
+ goto backtrack;
+ p++;
+ s++;
continue;
- }
- switch (*p++) {
+ } else
+ pc = *++p;
+ switch (pc) {
case '[':
+ p++;
+ s++;
if (sc == 0 || (p = cclass(p, sc)) == NULL)
- return 0;
- break;
+ break;
+ continue;
case '?':
if (sc == 0)
- return 0;
- break;
+ break;
+ p++;
+ s++;
+ continue;
case '*':
- if (p == pe)
- return 1;
- s--;
- do {
- if (do_gmatch(s, se, p, pe, isfile))
- return 1;
- } while (s++ < se);
- return 0;
-
+ pNext = p - 1;
+ sNext = s + 1;
+ p++;
+ continue;
/*
* [*+?@!](pattern|pattern|..)
*
@@ -678,13 +682,13 @@
*/
case 0x80|'+': /* matches one or more times */
case 0x80|'*': /* matches zero or more times */
- if (!(prest = pat_scan(p, pe, 0)))
- return 0;
+ if (!(prest = pat_scan(++p, pe, 0)))
+ break;
s--;
/* take care of zero matches */
if (p[-1] == (0x80 | '*')
&& do_gmatch(s, se, prest, pe, isfile))
- return 1;
+ continue;
for (psub = p; ; psub = pnext) {
pnext = pat_scan(psub, pe, 1);
for (srest = s; srest <= se; srest++) {
@@ -700,18 +704,18 @@
if (pnext == prest)
break;
}
- return 0;
+ break;
case 0x80|'?': /* matches zero or once */
case 0x80|'@': /* matches one of the patterns */
case 0x80|' ': /* simile for @ */
- if (!(prest = pat_scan(p, pe, 0)))
- return 0;
+ if (!(prest = pat_scan(++p, pe, 0)))
+ break;
s--;
/* Take care of zero matches */
if (p[-1] == (0x80 | '?')
&& do_gmatch(s, se, prest, pe, isfile))
- return 1;
+ continue;
for (psub = p; ; psub = pnext) {
pnext = pat_scan(psub, pe, 1);
srest = prest == pe ? se : s;
@@ -720,16 +724,16 @@
psub, pnext - 2, isfile)
&& do_gmatch(srest, se,
prest, pe, isfile))
- return 1;
+ continue;
}
if (pnext == prest)
break;
}
- return 0;
+ break;
case 0x80|'!': /* matches none of the patterns */
- if (!(prest = pat_scan(p, pe, 0)))
- return 0;
+ if (!(prest = pat_scan(++p, pe, 0)))
+ break;
s--;
for (srest = s; srest <= se; srest++) {
int matched = 0;
@@ -747,17 +751,25 @@
}
if (!matched && do_gmatch(srest, se,
prest, pe, isfile))
- return 1;
+ continue;
}
- return 0;
+ break;
Home |
Main Index |
Thread Index |
Old Index