mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 05:10:28 +02:00
44030: prompt: Return error for unrecognised colour name
This commit is contained in:
parent
4f6ac08af3
commit
ed4c8f3d5e
3 changed files with 15 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2019-02-03 dana <dana@dana.is>
|
||||||
|
|
||||||
|
* 44030: Src/prompt.c, Test/D01prompt.ztst: Return error for
|
||||||
|
unrecognised colour name
|
||||||
|
|
||||||
2019-01-28 Fredric Silberberg <fred@silberberg.xyz>
|
2019-01-28 Fredric Silberberg <fred@silberberg.xyz>
|
||||||
|
|
||||||
* github #32: Completion/Unix/Command/_git: Fix a typo in the
|
* github #32: Completion/Unix/Command/_git: Fix a typo in the
|
||||||
|
|
|
||||||
|
|
@ -1663,6 +1663,8 @@ match_colour(const char **teststrp, int is_fg, int colour)
|
||||||
/* default */
|
/* default */
|
||||||
return is_fg ? TXTNOFGCOLOUR : TXTNOBGCOLOUR;
|
return is_fg ? TXTNOFGCOLOUR : TXTNOBGCOLOUR;
|
||||||
}
|
}
|
||||||
|
if (colour < 0)
|
||||||
|
return TXT_ERROR;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
colour = (int)zstrtol(*teststrp, (char **)teststrp, 10);
|
colour = (int)zstrtol(*teststrp, (char **)teststrp, 10);
|
||||||
|
|
|
||||||
|
|
@ -221,3 +221,11 @@
|
||||||
print ${(%U)Y-%(v}
|
print ${(%U)Y-%(v}
|
||||||
0:Regression test for test on empty psvar
|
0:Regression test for test on empty psvar
|
||||||
>
|
>
|
||||||
|
|
||||||
|
# Unrecognised colour strings should produce the default sequence
|
||||||
|
f=${(%):-'%f'} # Recognised
|
||||||
|
Fdefault=${(%):-'%F{default}'} # Recognised
|
||||||
|
Freset=${(%):-'%F{reset}'} # Unrecognised
|
||||||
|
Ffoo=${(%):-'%F{foo}'} # Unrecognised
|
||||||
|
[[ $f == $Fdefault && $Fdefault == $Freset && $Freset == $Ffoo ]]
|
||||||
|
0:Regression test for workers/44029
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue