diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-06-02 16:43:02 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2011-06-02 16:51:07 +0200 |
commit | 2e081747b933087abecbbb756efd468c05eb04a7 (patch) | |
tree | 71ebfdaf872a457fb78990ad0638e0e30cb87275 | |
parent | cc74a7d598c250617339473e948c721a0c41465f (diff) | |
download | ModemManager-2e081747b933087abecbbb756efd468c05eb04a7.tar.gz |
serial-parser: allow 0 or more whitespaces before error code in regular expresions
-rw-r--r-- | src/mm-serial-parsers.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mm-serial-parsers.c b/src/mm-serial-parsers.c index f83301d2d..344e1bc7a 100644 --- a/src/mm-serial-parsers.c +++ b/src/mm-serial-parsers.c @@ -93,7 +93,7 @@ mm_serial_parser_v0_new (void) parser = g_slice_new (MMSerialParserV0); parser->generic_response = g_regex_new ("(\\d)\\0?\\r$", flags, 0, NULL); - parser->detailed_error = g_regex_new ("\\+CME ERROR: (\\d+)\\r\\n$", flags, 0, NULL); + parser->detailed_error = g_regex_new ("\\+CME ERROR:\\s*(\\d+)\\r\\n$", flags, 0, NULL); return parser; } @@ -220,10 +220,10 @@ mm_serial_parser_v1_new (void) parser->regex_ok = g_regex_new ("\\r\\nOK(\\r\\n)+$", flags, 0, NULL); parser->regex_connect = g_regex_new ("\\r\\nCONNECT.*\\r\\n", flags, 0, NULL); - parser->regex_cme_error = g_regex_new ("\\r\\n\\+CME ERROR: (\\d+)\\r\\n$", flags, 0, NULL); - parser->regex_cms_error = g_regex_new ("\\r\\n\\+CMS ERROR: (\\d+)\\r\\n$", flags, 0, NULL); - parser->regex_cme_error_str = g_regex_new ("\\r\\n\\+CME ERROR: ([^\\n\\r]+)\\r\\n$", flags, 0, NULL); - parser->regex_ezx_error = g_regex_new ("\\r\\n\\MODEM ERROR: (\\d+)\\r\\n$", flags, 0, NULL); + parser->regex_cme_error = g_regex_new ("\\r\\n\\+CME ERROR:\\s*(\\d+)\\r\\n$", flags, 0, NULL); + parser->regex_cms_error = g_regex_new ("\\r\\n\\+CMS ERROR:\\s*(\\d+)\\r\\n$", flags, 0, NULL); + parser->regex_cme_error_str = g_regex_new ("\\r\\n\\+CME ERROR:\\s*([^\\n\\r]+)\\r\\n$", flags, 0, NULL); + parser->regex_ezx_error = g_regex_new ("\\r\\n\\MODEM ERROR:\\s*(\\d+)\\r\\n$", flags, 0, NULL); parser->regex_unknown_error = g_regex_new ("\\r\\n(ERROR)|(COMMAND NOT SUPPORT)\\r\\n$", flags, 0, NULL); parser->regex_connect_failed = g_regex_new ("\\r\\n(NO CARRIER)|(BUSY)|(NO ANSWER)|(NO DIALTONE)\\r\\n$", flags, 0, NULL); |