From 25f88b2a9ff951837ddea0d006d015c4e0665828 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Fri, 6 Dec 2002 20:16:17 +0000 Subject: [PATCH] Using an internal version of basename --- mbfido/queue.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mbfido/queue.c b/mbfido/queue.c index d8ab81f2..e43bb09a 100644 --- a/mbfido/queue.c +++ b/mbfido/queue.c @@ -51,6 +51,18 @@ extern int do_quiet; extern int flushed; +/* + * Internal version of basename to make this better portable. + */ +char *Basename(char *); +char *Basename(char *str) +{ + char *cp = strrchr(str, '/'); + + return cp ? cp+1 : str; +} + + /* * Flush one queue directory of a node. If everything is successfull the @@ -553,7 +565,7 @@ void flush_dir(char *ndir) if (nodes.Session_out == S_DIRECT) { attach(noden, p, mode, flavor); } else if (nodes.Session_out == S_DIR) { - sprintf(arcfile, "%s/%s", nodes.Dir_out_path, basename(p)); + sprintf(arcfile, "%s/%s", nodes.Dir_out_path, Basename(p)); if (mode == LEAVE) { /* * LEAVE file, so we copy this one.