[interchange] strip_path filter

Mark Johnson <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit d1558823a7a5d8ea7c1b946cfd566d697c98c5ad
Author: Mark Johnson <[email protected]>
Date:   Sat Jan 18 22:59:39 2014 -0500

    strip_path filter
    
    * Filter to strip any arbitrary path elements down to just
      the filename, Win or Unix.

 code/Filter/strip_path.filter |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/code/Filter/strip_path.filter b/code/Filter/strip_path.filter
new file mode 100644
index 0000000..3def6a4
--- /dev/null
+++ b/code/Filter/strip_path.filter
@@ -0,0 +1,17 @@
+# Copyright 2002-2014 Interchange Development Group and others
+# Copyright 1996-2002 Red Hat, Inc.
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.  See the LICENSE file for details.
+
+CodeDef strip_path Filter
+CodeDef strip_path Description Strip all path segments, leaving file name
+CodeDef strip_path Routine <<EOR
+sub {
+    local $_ = shift;
+    s{.*[/\\]}{}s;
+    return $_;
+}
+EOR
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.