aboutsummaryrefslogtreecommitdiff
path: root/gnu/libexec/uucp/libunix/basnam.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/libexec/uucp/libunix/basnam.c')
-rw-r--r--gnu/libexec/uucp/libunix/basnam.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gnu/libexec/uucp/libunix/basnam.c b/gnu/libexec/uucp/libunix/basnam.c
new file mode 100644
index 000000000000..c61fcaa8de61
--- /dev/null
+++ b/gnu/libexec/uucp/libunix/basnam.c
@@ -0,0 +1,22 @@
+/* basnam.c
+ Get the base name of a file. */
+
+#include "uucp.h"
+
+#include "uudefs.h"
+#include "sysdep.h"
+#include "system.h"
+
+/* Get the base name of a file name. */
+
+char *
+zsysdep_base_name (zfile)
+ const char *zfile;
+{
+ const char *z;
+
+ z = strrchr (zfile, '/');
+ if (z != NULL)
+ return zbufcpy (z + 1);
+ return zbufcpy (zfile);
+}