Skip to content

Commit

Permalink
Sync one more upstream libmagic piece
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Nov 9, 2018
1 parent fab72d7 commit 22f71a6
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions ext/fileinfo/libmagic/softmagic.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,15 +657,12 @@ mprint(struct magic_set *ms, struct magic *m)
t = ms->offset + sizeof(double);
break;

case FILE_SEARCH:
case FILE_REGEX: {
char *cp;
int rval;

cp = estrndup((const char *)ms->search.s, ms->search.rm_len);
if (cp == NULL) {
file_oomem(ms, ms->search.rm_len);
return -1;
}
rval = file_printf(ms, F(ms, m, "%s"),
file_printable(sbuf, sizeof(sbuf), cp));
efree(cp);
Expand All @@ -680,15 +677,6 @@ mprint(struct magic_set *ms, struct magic *m)
break;
}

case FILE_SEARCH:
if (file_printf(ms, F(ms, m, "%s"), m->value.s) == -1)
return -1;
if ((m->str_flags & REGEX_OFFSET_START))
t = ms->search.offset;
else
t = ms->search.offset + m->vallen;
break;

case FILE_DEFAULT:
case FILE_CLEAR:
if (file_printf(ms, "%s", m->desc) == -1)
Expand Down

0 comments on commit 22f71a6

Please sign in to comment.