12345678910111213141516171819202122232425262728293031323334353637 |
- #!/bin/sh /usr/share/dpatch/dpatch-run
- @DPATCH@
- diff -Naur file-4.20.orig/src/softmagic.c file-4.20/src/softmagic.c
- --- file-4.20.orig/src/softmagic.c 2007-01-18 05:45:35.000000000 +0000
- +++ file-4.20/src/softmagic.c 2007-04-03 18:01:25.000000000 +0000
- @@ -38,7 +38,7 @@
-
-
- #ifndef lint
- -FILE_RCSID("@(#)$File: softmagic.c,v 1.91 2007/01/18 05:29:33 ljt Exp $")
- +FILE_RCSID("@(#)$File: softmagic.c,v 1.95 2007/03/03 19:09:25 christos Exp $")
- #endif /* lint */
-
- private int match(struct magic_set *, struct magic *, uint32_t,
- @@ -1523,10 +1523,20 @@
- }
- else {
- regmatch_t pmatch[1];
- +#ifndef REG_STARTEND
- +#define REG_STARTEND 0
- + size_t l = ms->search.s_len - 1;
- + char c = ms->search.s[l];
- + ((char *)(intptr_t)ms->search.s)[l] = '\0';
- +#else
- pmatch[0].rm_so = 0;
- pmatch[0].rm_eo = ms->search.s_len;
- +#endif
- rc = regexec(&rx, (const char *)ms->search.s,
- 1, pmatch, REG_STARTEND);
- +#if REG_STARTEND == 0
- + ((char *)(intptr_t)ms->search.s)[l] = c;
- +#endif
- switch (rc) {
- case 0:
- ms->search.s += (int)pmatch[0].rm_so;
|