Deleted Added
full compact
compile.c (197361) compile.c (197362)
1/*-
2 * Copyright (c) 1992 Diomidis Spinellis.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Diomidis Spinellis of Imperial College, University of London.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
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>
1/*-
2 * Copyright (c) 1992 Diomidis Spinellis.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Diomidis Spinellis of Imperial College, University of London.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
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__FBSDID("$FreeBSD: head/usr.bin/sed/compile.c 197361 2009-09-20 15:17:40Z dds $");
35__FBSDID("$FreeBSD: head/usr.bin/sed/compile.c 197362 2009-09-20 15:47:31Z dds $");
36
37#ifndef lint
38static const char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93";
39#endif
40
41#include <sys/types.h>
42#include <sys/stat.h>
43

--- 383 unchanged lines hidden (view full) ---

427 if (*s == ']')
428 *t++ = *s++;
429 for (; *s && (*t = *s) != ']'; s++, t++)
430 if (*s == '[' && ((d = *(s+1)) == '.' || d == ':' || d == '=')) {
431 *++t = *++s, t++, s++;
432 for (c = *s; (*t = *s) != ']' || c != d; s++, t++)
433 if ((c = *s) == '\0')
434 return NULL;
36
37#ifndef lint
38static const char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93";
39#endif
40
41#include <sys/types.h>
42#include <sys/stat.h>
43

--- 383 unchanged lines hidden (view full) ---

427 if (*s == ']')
428 *t++ = *s++;
429 for (; *s && (*t = *s) != ']'; s++, t++)
430 if (*s == '[' && ((d = *(s+1)) == '.' || d == ':' || d == '=')) {
431 *++t = *++s, t++, s++;
432 for (c = *s; (*t = *s) != ']' || c != d; s++, t++)
433 if ((c = *s) == '\0')
434 return NULL;
435 } else if (*s == '\\' && s[1] == 'n')
436 *t = '\n', s++;
435 }
437 return (*s == ']') ? *sp = ++s, ++t : NULL;
438}
439
440/*
441 * Compiles the regular expression in RE and returns a pointer to the compiled
442 * regular expression.
443 * Cflags are passed to regcomp.
444 */

--- 503 unchanged lines hidden ---
436 return (*s == ']') ? *sp = ++s, ++t : NULL;
437}
438
439/*
440 * Compiles the regular expression in RE and returns a pointer to the compiled
441 * regular expression.
442 * Cflags are passed to regcomp.
443 */

--- 503 unchanged lines hidden ---