summaryrefslogtreecommitdiff
path: root/src/apprentice.c
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2016-07-20 11:27:08 +0000
committerChristos Zoulas <christos@zoulas.com>2016-07-20 11:27:08 +0000
commit558649d66b57e365a8d2ea429db73df72bd3f0a9 (patch)
tree86d7dd612ab0fa954d7ad8c63ac42812ffa0841c /src/apprentice.c
parent7a880cbe4a493607cabd400f052989d557c522bc (diff)
downloadfile-git-558649d66b57e365a8d2ea429db73df72bd3f0a9.tar.gz
Add support for signed indirect offsets.
Diffstat (limited to 'src/apprentice.c')
-rw-r--r--src/apprentice.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/apprentice.c b/src/apprentice.c
index 8793982e..cd8250b1 100644
--- a/src/apprentice.c
+++ b/src/apprentice.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.250 2016/07/05 19:20:19 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.251 2016/07/20 11:27:08 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -1881,10 +1881,13 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
if (m->flag & INDIR) {
m->in_type = FILE_LONG;
m->in_offset = 0;
+ m->in_op = 0;
/*
- * read [.lbs][+-]nnnnn)
+ * read [.,lbs][+-]nnnnn)
*/
- if (*l == '.') {
+ if (*l == '.' || *l == ',') {
+ if (*l == ',')
+ m->in_op |= FILE_OPSIGNED;
l++;
switch (*l) {
case 'l':
@@ -1936,7 +1939,6 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
l++;
}
- m->in_op = 0;
if (*l == '~') {
m->in_op |= FILE_OPINVERSE;
l++;