From a263337f3ce1188cd703d2cd3e245792007a4425 Mon Sep 17 00:00:00 2001 From: Stephen Watson Date: Thu, 24 Feb 2005 20:40:23 +0000 Subject: [PATCH] r3828: Look out for new line character when reading EA MIME type under Solaris --- ROX-Filer/Help/Changes | 5 +++++ ROX-Filer/src/xtypes.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 57b1afaf..0f041faa 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -2,6 +2,11 @@ A RISC OS-like filer for X by Thomas Leonard +24-Feb-2005 +~~~~~~~~~~~ +Look out for new line character when reading EA MIME type under Solaris +(Stephen Watson). + 13-Feb-2005 ~~~~~~~~~~~ Added Estonian translation (Teet Tärno). diff --git a/ROX-Filer/src/xtypes.c b/ROX-Filer/src/xtypes.c index fe48622b..a8da4cd1 100644 --- a/ROX-Filer/src/xtypes.c +++ b/ROX-Filer/src/xtypes.c @@ -208,7 +208,7 @@ int xtype_have_attr(const char *path) MIME_type *xtype_get(const char *path) { int fd; - char buf[1024]; + char buf[1024], *nl; int nb; MIME_type *type=NULL; @@ -225,6 +225,9 @@ MIME_type *xtype_get(const char *path) nb=read(fd, buf, sizeof(buf)); if(nb>0) { buf[nb]=0; + nl=strchr(buf, '\n'); + if(nl) + *nl=0; type=mime_type_lookup(buf); } close(fd); -- 2.11.4.GIT