mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
Menu parser: remove d-quotes around title of entry
When a menu entry contains a space, it is necessary to enclose it in simple or double quotes; these were not removed and so would appear in the menu.
This commit is contained in:
committed by
Carlos R. Mafra
parent
9ad278ddf8
commit
b2e7620868
@@ -222,6 +222,21 @@ Bool WMenuParserGetLine(WMenuParser top_parser, char **title, char **command, ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (title != NULL) {
|
||||||
|
char eot, *src, *dst;
|
||||||
|
|
||||||
|
src = *title;
|
||||||
|
eot = *src++;
|
||||||
|
if ((eot == '"') || (eot == '\'')) {
|
||||||
|
dst = *title;
|
||||||
|
while (*src != '\0')
|
||||||
|
*dst++ = *src++;
|
||||||
|
if ((dst > *title) && (dst[-1] == eot))
|
||||||
|
dst--;
|
||||||
|
*dst = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (params != NULL) {
|
if (params != NULL) {
|
||||||
lineparam[sizeof(lineparam) - 1] = '\0';
|
lineparam[sizeof(lineparam) - 1] = '\0';
|
||||||
*parameter = wstrdup(lineparam);
|
*parameter = wstrdup(lineparam);
|
||||||
|
|||||||
Reference in New Issue
Block a user