If a file with name passed on command line exists, do not try to parse it as filename:line; this unbreaks opening files with names like 'foo:100'

This commit is contained in:
Yevgen Muntyan 2011-10-23 15:22:45 -07:00
parent 0a43d8bfda
commit d8c36d1c01

View File

@ -24,7 +24,7 @@ parse_filename (const char *filename)
return NULL;
}
if (g_utf8_validate (filename, -1, NULL))
if (!g_file_test (filename, G_FILE_TEST_EXISTS) && g_utf8_validate (filename, -1, NULL))
{
GError *error = NULL;
GRegex *re = g_regex_new ("((?P<path>.*):(?P<line>\\d+)?|(?P<path>.*)\\((?P<line>\\d+)\\))$",