diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1994-11-17 10:51:51 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1994-11-17 10:51:51 +0000 |
| commit | d08bdbd3d193faf73fbe56d85ae9f3938eec872b (patch) | |
| tree | 930db25d0662aa6e78783c1222bb89594145337b /usr.sbin/pkg_install/lib/str.c | |
| parent | 72012b54d03431c1fc4c658f9e67bdff4a71f336 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/pkg_install/lib/str.c')
| -rw-r--r-- | usr.sbin/pkg_install/lib/str.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.sbin/pkg_install/lib/str.c b/usr.sbin/pkg_install/lib/str.c index 8d68f9291f1d..7c61f96f67bf 100644 --- a/usr.sbin/pkg_install/lib/str.c +++ b/usr.sbin/pkg_install/lib/str.c @@ -24,6 +24,18 @@ static const char *rcsid = "$Id"; #include "lib.h" +/* Return the filename portion of a path */ +char * +basename_of(char *str) +{ + char *basename = str + strlen(str) - 1; + + while (basename != str && basename[-1] != '/') + --basename; + return basename; +} + +/* Get a string parameter as a file spec or as a "contents follow -" spec */ char * get_dash_string(char **str) { @@ -36,6 +48,7 @@ get_dash_string(char **str) return *str; } +/* Rather Obvious */ char * copy_string(char *str) { |
