util.c (119614) | util.c (136759) |
---|---|
1/* $FreeBSD: head/contrib/libreadline/util.c 119614 2003-08-31 18:29:38Z ache $ */ | 1/* $FreeBSD: head/contrib/libreadline/util.c 136759 2004-10-21 20:10:14Z peter $ */ 2 |
2/* util.c -- readline utility functions */ 3 4/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. 5 6 This file is part of the GNU Readline Library, a library for 7 reading lines of text with interactive input and history editing. 8 9 The GNU Readline Library is free software; you can redistribute it --- 224 unchanged lines hidden (view full) --- 234 register const char *scan; 235#if defined (HANDLE_MULTIBYTE) 236 mbstate_t ps; 237 register int i, v; 238 239 memset (&ps, 0, sizeof (mbstate_t)); 240#endif 241 | 3/* util.c -- readline utility functions */ 4 5/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. 6 7 This file is part of the GNU Readline Library, a library for 8 reading lines of text with interactive input and history editing. 9 10 The GNU Readline Library is free software; you can redistribute it --- 224 unchanged lines hidden (view full) --- 235 register const char *scan; 236#if defined (HANDLE_MULTIBYTE) 237 mbstate_t ps; 238 register int i, v; 239 240 memset (&ps, 0, sizeof (mbstate_t)); 241#endif 242 |
242 if (string2 == NULL) 243 return ((char *)NULL); 244 | |
245 for (; *string1; string1++) 246 { 247 for (scan = string2; *scan; scan++) 248 { 249 if (*string1 == *scan) 250 return ((char *)string1); 251 } 252#if defined (HANDLE_MULTIBYTE) 253 if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) 254 { 255 v = _rl_get_char_len (string1, &ps); 256 if (v > 1) | 243 for (; *string1; string1++) 244 { 245 for (scan = string2; *scan; scan++) 246 { 247 if (*string1 == *scan) 248 return ((char *)string1); 249 } 250#if defined (HANDLE_MULTIBYTE) 251 if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) 252 { 253 v = _rl_get_char_len (string1, &ps); 254 if (v > 1) |
257 string += v - 1; /* -1 to account for auto-increment in loop */ | 255 string1 += v - 1; /* -1 to account for auto-increment in loop */ |
258 } 259#endif 260 } 261 return ((char *)NULL); 262} 263#endif 264 265#if !defined (HAVE_STRCASECMP) --- 77 unchanged lines hidden --- | 256 } 257#endif 258 } 259 return ((char *)NULL); 260} 261#endif 262 263#if !defined (HAVE_STRCASECMP) --- 77 unchanged lines hidden --- |