mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gshell: Fix parsing of comments in command lines.
Fixes bug 562907
This commit is contained in:
@@ -520,6 +520,24 @@ tokenize_command_line (const gchar *command_line,
|
||||
/* FALL THRU */
|
||||
|
||||
case '#':
|
||||
if (p == command_line)
|
||||
{ /* '#' was the first char */
|
||||
current_quote = *p;
|
||||
break;
|
||||
}
|
||||
switch(*(p-1))
|
||||
{
|
||||
case ' ':
|
||||
case '\n':
|
||||
case '\0':
|
||||
current_quote = *p;
|
||||
break;
|
||||
default:
|
||||
ensure_token (¤t_token);
|
||||
g_string_append_c (current_token, *p);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\\':
|
||||
current_quote = *p;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user