str.c (200462) | str.c (213284) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> 35 | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> 35 |
36__FBSDID("$FreeBSD: head/usr.bin/tr/str.c 200462 2009-12-13 03:14:06Z delphij $"); | 36__FBSDID("$FreeBSD: head/usr.bin/tr/str.c 213284 2010-09-29 22:24:18Z jilles $"); |
37 38#ifndef lint 39static const char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95"; 40#endif 41 42#include <sys/types.h> 43 44#include <ctype.h> --- 106 unchanged lines hidden (view full) --- 151 if (*(p - 1) != ':' || p - s->str < 4) 152 goto repeat; 153 *(p - 1) = '\0'; 154 s->str += 2; 155 genclass(s); 156 s->str = p + 1; 157 return (1); 158 case '=': /* "[=equiv=]" */ | 37 38#ifndef lint 39static const char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95"; 40#endif 41 42#include <sys/types.h> 43 44#include <ctype.h> --- 106 unchanged lines hidden (view full) --- 151 if (*(p - 1) != ':' || p - s->str < 4) 152 goto repeat; 153 *(p - 1) = '\0'; 154 s->str += 2; 155 genclass(s); 156 s->str = p + 1; 157 return (1); 158 case '=': /* "[=equiv=]" */ |
159 if ((p = strchr(s->str + 2, ']')) == NULL) | 159 if (s->str[2] == '\0' || (p = strchr(s->str + 3, ']')) == NULL) |
160 return (0); 161 if (*(p - 1) != '=' || p - s->str < 4) 162 goto repeat; 163 s->str += 2; 164 genequiv(s); 165 return (1); 166 default: /* "[\###*n]" or "[#*n]" */ 167 repeat: --- 229 unchanged lines hidden --- | 160 return (0); 161 if (*(p - 1) != '=' || p - s->str < 4) 162 goto repeat; 163 s->str += 2; 164 genequiv(s); 165 return (1); 166 default: /* "[\###*n]" or "[#*n]" */ 167 repeat: --- 229 unchanged lines hidden --- |