nodejs/node · warning
U_PARSE_ERROR
U_PARSE_ERROR
Error message
icupkg: syntax error (more than one '*') in item pattern "%s"
What it means
icupkg accepts item patterns with at most one '*' wildcard (a prefix and optional suffix). If a pattern contains two or more asterisks, parsing is ambiguous and the tool exits with U_PARSE_ERROR. This affects findNext/match operations used by -l/-x/-r item selectors.
Source
Thrown at deps/icu-small/source/tools/toolutil/package.cpp:959
return;
}
findPrefix=pattern;
findSuffix=nullptr;
findSuffixLength=0;
wild=strchr(pattern, '*');
if(wild==nullptr) {
// no wildcard
findPrefixLength = static_cast<int32_t>(strlen(pattern));
} else {
// one wildcard
findPrefixLength = static_cast<int32_t>(wild - pattern);
findSuffix=wild+1;
findSuffixLength = static_cast<int32_t>(strlen(findSuffix));
if(nullptr!=strchr(findSuffix, '*')) {
// two or more wildcards
fprintf(stderr, "icupkg: syntax error (more than one '*') in item pattern \"%s\"\n", pattern);
exit(U_PARSE_ERROR);
}
}
if(findPrefixLength==0) {
findNextIndex=0;
} else {
findNextIndex=findItem(findPrefix, findPrefixLength);
}
}
int32_t
Package::findNextItem() {
const char *name, *middle, *treeSep;
int32_t idx, nameLength, middleLength;
if(findNextIndex<0) {
return -1;View on GitHub (pinned to 1b2de5e052)
Solutions
- Reduce the pattern to a single wildcard, e.g. 'foo*bar' instead of 'foo*bar*'.
- Quote the pattern to prevent shell glob expansion from injecting extra '*' characters.
- Run two separate icupkg invocations with single-wildcard patterns if you need broader matching.
Example fix
# before icupkg in.dat -x 'res_*_*.res' # after - single wildcard, quoted icupkg in.dat -x 'res_*'
Defensive patterns
Strategy: type-guard
Validate before calling
# Reject item patterns with more than one '*' before passing to icupkg.
valid_pattern() {
local p="$1"
# remove the first '*', ensure none remain
[ "${p/\*}" = "$p" ] && return 0 # zero wildcards: ok
rest="${p#*\*}"
case "$rest" in *'*'*) return 1 ;; *) return 0 ;; esac
}
valid_pattern "$PAT" || { echo "pattern '$PAT' has >1 wildcard" >&2; exit 1; }
icupkg in.dat -x "$PAT" Type guard
// TypeScript/JS type guard for an icupkg item pattern (at most one '*').
function isIcupkgItemPattern(p: string): boolean {
const first = p.indexOf('*');
if (first === -1) return true; // no wildcard
return p.indexOf('*', first + 1) === -1; // no second wildcard
} Prevention
- Quote icupkg patterns to stop the shell from expanding globs.
- Use at most one '*' per pattern; run multiple icupkg calls for broader matching.
- Add a pattern validator in build scripts that compose wildcard fragments.
When it happens
Trigger: In the pattern parser, after locating the first '*' and computing findSuffix, 'strchr(findSuffix, '*')' returns non-null (a second wildcard). Fires for patterns like 'foo*bar*baz' or '**'.
Common situations: Shell-glob habits leaking into icupkg item patterns; a typo doubling the asterisk; scripting that concatenates wildcard fragments producing '**'.
Related errors
- U_ILLEGAL_ARGUMENT_ERROR
- errorCode
- An error occurred processing file %s. Error: %s
- couldn't parse the file %s. Error:%s
- U_MEMORY_ALLOCATION_ERROR
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/b1e05e6a61725a5c.
Report an issue: GitHub.