From 932aad31b327ad51e6008dd95a0314c7ef765a47 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 24 Jul 2005 10:03:55 +0000 Subject: [PATCH] r4033: An executable text file of unknown type is marked as executable if its name doesn't contain a '.'. This is so that 'readme.txt' on a filesystem with all execute bits set is seen as text, but a shell script with no extension or interpreter header still shows up as an executable on Solaris (Thomas Leonard; requested by Stephen Watson). --- ROX-Filer/Help/Changes | 9 +++++++++ ROX-Filer/src/diritem.c | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index fcc391bf..ebdd6583 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -1,6 +1,15 @@ ROX-Filer A RISC OS-like filer for X by Thomas Leonard + +24-Jul-2005 +~~~~~~~~~~~ +An executable text file of unknown type is marked as executable if its name +doesn't contain a '.'. This is so that 'readme.txt' on a filesystem with +all execute bits set is seen as text, but a shell script with no extension +or interpreter header still shows up as an executable on Solaris (Thomas +Leonard; requested by Stephen Watson). + 23-Jul-2005 ~~~~~~~~~~~ Added icon for messages (Thomas Leonard). diff --git a/ROX-Filer/src/diritem.c b/ROX-Filer/src/diritem.c index 1d5fc9ce..11372f28 100644 --- a/ROX-Filer/src/diritem.c +++ b/ROX-Filer/src/diritem.c @@ -177,8 +177,13 @@ void diritem_restat(const guchar *path, DirItem *item, struct stat *parent) */ item->flags |= ITEM_FLAG_EXEC_FILE; - if (item->mime_type == NULL || item->mime_type == application_octet_stream) + if (item->mime_type == NULL || + item->mime_type == application_octet_stream || + (item->mime_type == text_plain && + !strchr(item->leafname, '.'))) + { item->mime_type = application_executable; + } } if (!item->mime_type) -- 2.11.4.GIT