Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / include / last-path-component.h
blobf7f1a086a2a31b3cfb59c7372d56b5aca7bb6937
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
6 * This file is part of LVM2.
8 * This copyrighted material is made available to anyone wishing to use,
9 * modify, copy, or redistribute it subject to the terms and conditions
10 * of the GNU Lesser General Public License v.2.1.
12 * You should have received a copy of the GNU Lesser General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Return the address of the last file name component of NAME.
19 * If NAME ends in a slash, return the empty string.
22 #include <string.h>
24 static inline const char *last_path_component(char const *name)
26 char const *slash = strrchr(name, '/');
28 return (slash) ? slash + 1 : name;