--- rxvt-unicode/src/misc.C 2004/02/13 12:16:21 1.7 +++ rxvt-unicode/src/misc.C 2004/03/03 04:07:52 1.9 @@ -6,6 +6,7 @@ * Copyright (c) 1996 mj olesen Queen's Univ at Kingston * Copyright (c) 1997,1998 Oezguer Kesim * Copyright (c) 1998-2000 Geoff Wing + * Copyright (c) 2003-2004 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,10 +35,10 @@ } /* EXTPROTO */ -char * +char * rxvt_r_basename (const char *str) { - char *base = STRRCHR (str, '/'); + char *base = STRRCHR (str, '/'); return (char *) (base ? base + 1 : str); } @@ -49,10 +50,10 @@ void rxvt_print_error (const char *fmt,...) { - va_list arg_ptr; + va_list arg_ptr; va_start (arg_ptr, fmt); - fprintf (stderr, APL_NAME ": "); + fprintf (stderr, RESNAME ": "); vfprintf (stderr, fmt, arg_ptr); fprintf (stderr, "\n"); va_end (arg_ptr); @@ -70,18 +71,19 @@ int rxvt_Str_match (const char *s1, const char *s2) { - int n = STRLEN (s2); + int n = STRLEN (s2); return ((STRNCMP (s1, s2, n) == 0) ? n : 0); } /* EXTPROTO */ -const char * +const char * rxvt_Str_skip_space (const char *str) { if (str) while (*str && isspace (*str)) str++; + return str; } @@ -93,8 +95,8 @@ char * rxvt_Str_trim (char *str) { - char *r, *s; - int n; + char *r, *s; + int n; if (!str || !*str) /* shortcut */ return str; @@ -115,6 +117,7 @@ s++; n -= 2; } + /* copy back over: forwards copy */ for (r = str; n; n--) *r++ = *s++;