summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/compat/basename.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nsd/compat/basename.c')
-rw-r--r--usr.sbin/nsd/compat/basename.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/nsd/compat/basename.c b/usr.sbin/nsd/compat/basename.c
new file mode 100644
index 00000000000..cd8600c31ea
--- /dev/null
+++ b/usr.sbin/nsd/compat/basename.c
@@ -0,0 +1,18 @@
+/* Return the basename of a pathname.
+ This file is in the public domain. */
+
+char *
+basename (name)
+ const char *name;
+{
+ const char *base;
+
+ for (base = name; *name; name++)
+ {
+ if (*name == '/')
+ {
+ base = name + 1;
+ }
+ }
+ return (char *) base;
+}