Author: matthew Date: 2007-03-04 12:27:03 -0700 (Sun, 04 Mar 2007) New Revision: 1769
Added: trunk/file/file-4.20-reg_startend-1.patch Log: Add an upstream bugfix patch for File-4.20 Added: trunk/file/file-4.20-reg_startend-1.patch =================================================================== --- trunk/file/file-4.20-reg_startend-1.patch (rev 0) +++ trunk/file/file-4.20-reg_startend-1.patch 2007-03-04 19:27:03 UTC (rev 1769) @@ -0,0 +1,40 @@ +Submitted By: Matt Burgess (matthew at linuxfromscratch dot org) +Date: 2007-03-04 +Initial Package Version: 4.20 +Origin: ftp://ftp.gw.com/mirrors/pub/unix/file/Upstream/patch-4.20-REG_STARTEND +Upstream Status: Applied +Description: Fixes a bug caused by an undefined constant + +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-03-04 10:19:57.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; -- http://linuxfromscratch.org/mailman/listinfo/patches FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
