ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/misc.C
(Generate patch)

Comparing rxvt-unicode/src/misc.C (file contents):
Revision 1.43 by ayin, Mon Aug 27 20:53:16 2007 UTC vs.
Revision 1.44 by ayin, Mon Sep 3 07:31:12 2007 UTC

233 static class rxvt_failure_exception rxvt_failure_exception; 233 static class rxvt_failure_exception rxvt_failure_exception;
234 throw (rxvt_failure_exception); 234 throw (rxvt_failure_exception);
235} 235}
236 236
237/* 237/*
238 * remove leading/trailing space and strip-off leading/trailing quotes. 238 * remove leading/trailing space in place.
239 * in place.
240 */ 239 */
241char * 240char *
242rxvt_Str_trim (char *str) NOTHROW 241rxvt_Str_trim (char *str) NOTHROW
243{ 242{
244 char *r, *s; 243 char *r, *s;
253 r = s + strlen (s) - 1; 252 r = s + strlen (s) - 1;
254 253
255 /* dump return and other trailing whitespace */ 254 /* dump return and other trailing whitespace */
256 while (r > s && isspace (*r)) 255 while (r > s && isspace (*r))
257 r--; 256 r--;
258
259#if 0
260 /* skip matching leading/trailing quotes */
261 if (*s == '"' && *r == '"' && n > 1)
262 {
263 s++;
264 n -= 2;
265 }
266#endif
267 257
268 memmove (str, s, r + 1 - s); 258 memmove (str, s, r + 1 - s);
269 str[r + 1 - s] = 0; 259 str[r + 1 - s] = 0;
270 260
271 return str; 261 return str;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines