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>
* execute.c (do_execute): Make static. Print end of line after

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

@ -56,7 +56,6 @@ flush_extension_file (void)
g_free (data);
data = NULL;
}
}
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)
*pp = 0;
if (islocal && !strncmp (content_string, filename, file_len)) {
/* Skip "filename: " */
content_shift = file_len;
if (content_string[content_shift] == ':')
for (content_shift++;
if (islocal) {
if (!strncmp (content_string, filename, file_len)) {
/* Skip "filename: " */
content_shift = file_len;
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_shift++);
} else if (!islocal
&& !strncmp (content_string, "standard input:",
15)) {
/* Skip "standard input: " */
for (content_shift = 15;
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 if (!strncmp (content_string, "/dev/stdin:", 11)) {
/* Skip "/dev/stdin: " */
for (content_shift = 11;
content_string[content_shift] == ' ';
content_shift++);
}
}
} else {
/* No data */
@ -449,9 +452,8 @@ regex_check_type (char *filename, int file_len, char *ptr, int *have_type)
return -1;
}
if (content_string && content_string[0]
&& regexp_match (ptr, content_string + content_shift,
match_regex)) {
if (content_string[0]
&& regexp_match (ptr, content_string + content_shift, match_regex)) {
found = 1;
}