Commit 52d78545 authored by rswindell's avatar rswindell
Browse files

Changed lastchar() to return a pointer to the last char in the string.

parent 32841dac
......@@ -364,7 +364,7 @@ BOOL DLLCALL fexist(const char *filespec)
// make sure it's not a directory
c = g.gl_pathc;
while (c--) {
if (lastchar(g.gl_pathv[c]) != '/') {
if (*lastchar(g.gl_pathv[c]) != '/') {
globfree(&g);
return TRUE;
}
......
......@@ -58,15 +58,16 @@
/****************************************************************************/
/* Return last character of string */
/****************************************************************************/
char DLLCALL lastchar(const char* str)
const char* DLLCALL lastchar(const char* str)
{
size_t len;
len = strlen(str);
if(len)
return(str[len-1]);
return(0);
return(&str[len-1]);
return(str);
}
/****************************************************************************/
......
......@@ -123,7 +123,7 @@ extern "C" {
#endif
#endif
DLLEXPORT char DLLCALL lastchar(const char* str);
DLLEXPORT const char* DLLCALL lastchar(const char* str);
/****************************/
/* Common Utility Functions */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment