[PATCH] Problem with type/ keyword in mc.ext on Solaris
Dmitry Sivachenko
mitya at cavia.pp.ru
Wed Aug 17 10:09:49 UTC 2005
Hello!
The file(1) command distributed with Solaris OS is different from Linus/BSD
ones. It's output has the following format:
filename.ext:<TAB>Some text
instead of
filename.ext:<SPACE>Some text
Thus the following line in mc.ext does not work:
type/^gzip
Open=gzip -dc %f | %var{PAGER:more}
View=%view{ascii} gzip -dc %f 2>/dev/null
The following patch fixed the issue.
Please include it into distribution.
Thanks!
--- ext.c.orig Срд Авг 17 13:11:24 2005
+++ ext.c Срд Авг 17 14:03:09 2005
@@ -428,7 +428,8 @@
content_shift = file_len;
if (content_string[content_shift] == ':')
for (content_shift++;
- content_string[content_shift] == ' ';
+ content_string[content_shift] == ' ' ||
+ content_string[content_shift] == '\t';
content_shift++);
} else if (!islocal
&& !strncmp (content_string, "standard input:",
@@ -435,7 +436,8 @@
15)) {
/* Skip "standard input: " */
for (content_shift = 15;
- content_string[content_shift] == ' ';
+ content_string[content_shift] == ' ' ||
+ content_string[content_shift] == '\t';
content_shift++);
}
} else {
More information about the mc
mailing list