From 4acae4da032ebd045456d3a625cc96ad4d4745d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sun, 18 Nov 2007 14:12:01 +0000 Subject: Use the strrsplt function in one more place git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15662 a1c6a512-1295-4272-9138-f99709370657 --- apps/misc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'apps/misc.c') diff --git a/apps/misc.c b/apps/misc.c index d81794d..4af97af 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -1076,3 +1076,19 @@ int hex_to_rgb(const char* hex) } #endif /* HAVE_LCD_COLOR */ +char* strrsplt(char* str, int c) +{ + char* s = strrchr(str, c); + + if (s != NULL) + { + *s++ = '\0'; + } + else + { + s = str; + } + + return s; +} + -- cgit v1.1