summaryrefslogtreecommitdiffstats
path: root/contrib/less/filename.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2011-05-09 21:51:59 +0000
committerdelphij <delphij@FreeBSD.org>2011-05-09 21:51:59 +0000
commit142a49a4be37258477d8ce2b19011a75c36bd418 (patch)
treee6e6402d1f7ea7e3382a94b4f654586f41b93f2c /contrib/less/filename.c
parent39f7e10a268694e139c11157f966ca179b834212 (diff)
downloadFreeBSD-src-142a49a4be37258477d8ce2b19011a75c36bd418.zip
FreeBSD-src-142a49a4be37258477d8ce2b19011a75c36bd418.tar.gz
MFV: Update to less v443.
MFC after: 1 month
Diffstat (limited to 'contrib/less/filename.c')
-rw-r--r--contrib/less/filename.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/contrib/less/filename.c b/contrib/less/filename.c
index fb6f389..0bbe82a 100644
--- a/contrib/less/filename.c
+++ b/contrib/less/filename.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2009 Mark Nudelman
+ * Copyright (C) 1984-2011 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -400,6 +400,7 @@ fexpand(s)
return (e);
}
+
#if TAB_COMPLETE_FILENAME
/*
@@ -1057,3 +1058,22 @@ shell_coption()
{
return ("-c");
}
+
+/*
+ * Return last component of a pathname.
+ */
+ public char *
+last_component(name)
+ char *name;
+{
+ char *slash;
+
+ for (slash = name + strlen(name); slash > name; )
+ {
+ --slash;
+ if (*slash == *PATHNAME_SEP || *slash == '/')
+ return (slash + 1);
+ }
+ return (name);
+}
+
OpenPOWER on IntegriCloud