diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-07-13 08:54:57 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-07-13 08:54:57 +0000 |
commit | 6b9cc76d0a27631fbab19a31ab8bd46e143b7580 (patch) | |
tree | 7153d03691decf028fa422dac86d3aec46908f54 /plugins/utils.c | |
parent | a46e358d68027289cffaffeb7a4b32ababb2105b (diff) | |
download | monitoring-plugins-6b9cc76d0a27631fbab19a31ab8bd46e143b7580.tar.gz |
Using coreutils' base_name function because of portability issues with
Tru64
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1450 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r-- | plugins/utils.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/plugins/utils.c b/plugins/utils.c index a455f225..cb013412 100644 --- a/plugins/utils.c +++ b/plugins/utils.c | |||
@@ -640,33 +640,6 @@ strpcat (char *dest, const char *src, const char *str) | |||
640 | return dest; | 640 | return dest; |
641 | } | 641 | } |
642 | 642 | ||
643 | #ifndef HAVE_BASENAME | ||
644 | /* function modified from coreutils base_name function - see ACKNOWLEDGEMENTS */ | ||
645 | char *basename(const char *path) { | ||
646 | char const *base = path; | ||
647 | char const *p; | ||
648 | for (p = base; *p; p++) { | ||
649 | if (*p == '/') { | ||
650 | /* Treat multiple adjacent slashes like single slash */ | ||
651 | do p++; | ||
652 | while (*p == '/'); | ||
653 | |||
654 | /* If filename ends in slash, use trailing slash | ||
655 | as basename if no non-slashes found */ | ||
656 | if (! *p) { | ||
657 | if (*base == '/') | ||
658 | base = p - 1; | ||
659 | break; | ||
660 | } | ||
661 | |||
662 | /* *p is non-slash preceded by slash */ | ||
663 | base = p; | ||
664 | } | ||
665 | } | ||
666 | return (char *) base; | ||
667 | } | ||
668 | #endif | ||
669 | |||
670 | /****************************************************************************** | 643 | /****************************************************************************** |
671 | * | 644 | * |
672 | * Print perfdata in a standard format | 645 | * Print perfdata in a standard format |