From 0102c6e2bc289352ab726d68956c126727cf8d81 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 29 Jul 2011 16:14:39 +0200 Subject: s3: Make is_executable() available in lib/ --- source3/lib/util.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index b8fc319a6f..b320931146 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2238,3 +2238,20 @@ char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname) return ptr; } + +/******************************************************************* + Return True if the filename is one of the special executable types. +********************************************************************/ + +bool is_executable(const char *fname) +{ + if ((fname = strrchr_m(fname,'.'))) { + if (strequal(fname,".com") || + strequal(fname,".dll") || + strequal(fname,".exe") || + strequal(fname,".sym")) { + return True; + } + } + return False; +} -- cgit