1
1

* ext.c (regex_check_type): Strip tab(s) after "filename:" in

file output.
Этот коммит содержится в:
Pavel Roskin 2003-06-25 06:32:46 +00:00
родитель e54ac85df6
Коммит e31a950387
2 изменённых файлов: 30 добавлений и 23 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2003-06-25 Andrew V. Samoilov <sav@bcs.zp.ua>
* ext.c (regex_check_type): Strip tab(s) after "filename:" in
file output.
2003-06-22 Pavel Roskin <proski@gnu.org> 2003-06-22 Pavel Roskin <proski@gnu.org>
* execute.c (do_execute): Make static. Print end of line after * execute.c (do_execute): Make static. Print end of line after

Просмотреть файл

@ -56,7 +56,6 @@ flush_extension_file (void)
g_free (data); g_free (data);
data = NULL; data = NULL;
} }
} }
typedef char *(*quote_func_t) (const char *name, int i); typedef char *(*quote_func_t) (const char *name, int i);
@ -417,27 +416,31 @@ regex_check_type (char *filename, int file_len, char *ptr, int *have_type)
if ((pp = strchr (content_string, '\n')) != 0) if ((pp = strchr (content_string, '\n')) != 0)
*pp = 0; *pp = 0;
if (islocal && !strncmp (content_string, filename, file_len)) { if (islocal) {
/* Skip "filename: " */ if (!strncmp (content_string, filename, file_len)) {
content_shift = file_len; /* Skip "filename: " */
if (content_string[content_shift] == ':') content_shift = file_len;
for (content_shift++; if (content_string[content_shift] == ':') {
content_shift++;
/* Solaris' file prints tab after ':' */
for (content_shift++;
content_string[content_shift] == ' '
|| content_string[content_shift] == '\t';
content_shift++);
}
}
} else {
if (!strncmp (content_string, "standard input:", 15)) {
/* Skip "standard input: " */
for (content_shift = 15;
content_string[content_shift] == ' '; content_string[content_shift] == ' ';
content_shift++); content_shift++);
} else if (!islocal } else if (!strncmp (content_string, "/dev/stdin:", 11)) {
&& !strncmp (content_string, "standard input:", /* Skip "/dev/stdin: " */
15)) { for (content_shift = 11;
/* Skip "standard input: " */ content_string[content_shift] == ' ';
for (content_shift = 15; content_shift++);
content_string[content_shift] == ' '; }
content_shift++);
} else if (!islocal
&& !strncmp (content_string, "/dev/stdin:",
11)) {
/* Skip "/dev/stdin: " */
for (content_shift = 11;
content_string[content_shift] == ' ';
content_shift++);
} }
} else { } else {
/* No data */ /* No data */
@ -449,9 +452,8 @@ regex_check_type (char *filename, int file_len, char *ptr, int *have_type)
return -1; return -1;
} }
if (content_string && content_string[0] if (content_string[0]
&& regexp_match (ptr, content_string + content_shift, && regexp_match (ptr, content_string + content_shift, match_regex)) {
match_regex)) {
found = 1; found = 1;
} }