tre-fastmatch.c (253888) | tre-fastmatch.c (265161) |
---|---|
1/* $FreeBSD: stable/9/usr.bin/grep/regex/tre-fastmatch.c 253888 2013-08-02 17:13:29Z ache $ */ | 1/* $FreeBSD: stable/9/usr.bin/grep/regex/tre-fastmatch.c 265161 2014-04-30 20:46:52Z pfg $ */ |
2 3/*- 4 * Copyright (c) 1999 James Howard and Dag-Erling Co��dan Sm��rgrav 5 * Copyright (C) 2008-2011 Gabor Kovesdan <gabor@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 429 unchanged lines hidden (view full) --- 439 arr[g] = plen - 1 - i; \ 440 for (unsigned int i = 0; i <= plen - 2; i++) \ 441 arr[plen - 1 - suff[i]] = plen - 1 - i; \ 442 \ 443 xfree(suff); \ 444 } 445 446/* | 2 3/*- 4 * Copyright (c) 1999 James Howard and Dag-Erling Co��dan Sm��rgrav 5 * Copyright (C) 2008-2011 Gabor Kovesdan <gabor@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 429 unchanged lines hidden (view full) --- 439 arr[g] = plen - 1 - i; \ 440 for (unsigned int i = 0; i <= plen - 2; i++) \ 441 arr[plen - 1 - suff[i]] = plen - 1 - i; \ 442 \ 443 xfree(suff); \ 444 } 445 446/* |
447 * Copies the pattern pat having lenght n to p and stores | 447 * Copies the pattern pat having length n to p and stores |
448 * the size in l. 449 */ 450#define SAVE_PATTERN(src, srclen, dst, dstlen) \ 451 dstlen = srclen; \ 452 dst = xmalloc((dstlen + 1) * sizeof(tre_char_t)); \ 453 if (dst == NULL) \ 454 return REG_ESPACE; \ 455 if (dstlen > 0) \ --- 587 unchanged lines hidden --- | 448 * the size in l. 449 */ 450#define SAVE_PATTERN(src, srclen, dst, dstlen) \ 451 dstlen = srclen; \ 452 dst = xmalloc((dstlen + 1) * sizeof(tre_char_t)); \ 453 if (dst == NULL) \ 454 return REG_ESPACE; \ 455 if (dstlen > 0) \ --- 587 unchanged lines hidden --- |