Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug (?) with ${(M)NAME:+WORD} and ${(P)NAME}
- X-seq: zsh-workers 51324
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Bug (?) with ${(M)NAME:+WORD} and ${(P)NAME}
- Date: Mon, 23 Jan 2023 12:45:07 -0800
- Archived-at: <https://zsh.org/workers/51324>
- List-id: <zsh-workers.zsh.org>
This works:
() {
local foo
() {
print ${(Mt)foo:#*local*}
print ${${(Mt)foo:#*local*}:+LOCAL}
}
}
This does not:
() {
local foo
() {
print ${(MtP)1:#*local*}
print ${${(MtP)1:#*local*}:+LOCAL}
} foo
}
No alternate nesting of (M) and (P) gives the expected result from :+
The (t) there is not the issue, the same thing happens with:
() {
local foo=xx-local-xx
() {
print ${(MP)1:#*local*}
print ${${(MP)1:#*local*}:+LOCAL}
} foo
}
Am I missing something?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author