[BACK]Return to magic-test.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / file

Diff for /src/usr.bin/file/magic-test.c between version 1.11 and 1.12

version 1.11, 2015/08/12 07:43:27 version 1.12, 2015/08/12 09:29:49
Line 677 
Line 677 
         if (result == !ml->test_not) {          if (result == !ml->test_not) {
                 if (ml->result != NULL)                  if (ml->result != NULL)
                         magic_add_string(ms, ml, s, slen);                          magic_add_string(ms, ml, s, slen);
                 if (result)                  if (result && ml->test_operator == '=')
                         ms->offset += slen + 1;                          ms->offset += slen + 1;
         }          }
         return (result);          return (result);
Line 919 
Line 919 
         m.rm_eo = ms->size;          m.rm_eo = ms->size;
   
         result = (regexec(&re, ms->base, 1, &m, REG_STARTEND) == 0);          result = (regexec(&re, ms->base, 1, &m, REG_STARTEND) == 0);
         if (result == !ml->test_not && ml->result != NULL) {          if (result == !ml->test_not) {
                 magic_add_result(ms, ml, "%s", "");                  if (ml->result != NULL)
                           magic_add_result(ms, ml, "%s", "");
                 if (result) {                  if (result) {
                         if (sflag)                          if (sflag)
                                 ms->offset = m.rm_so;                                  ms->offset = m.rm_so;
Line 1022 
Line 1023 
         }          }
         result = (found != NULL);          result = (found != NULL);
   
         if (result == !ml->test_not && ml->result != NULL && found != NULL) {          if (result == !ml->test_not) {
                 magic_add_string(ms, ml, found, ms->size - ms->offset);                  if (ml->result != NULL)
                 ms->offset = found - start + size;                          magic_add_string(ms, ml, found, ms->size - ms->offset);
                   if (result && found != NULL && ml->test_operator == '=')
                           ms->offset = (found + size) - ms->base;
         }          }
         return (result);          return (result);
 }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12