[File] Negative indexing breaks search

Toni Ruottu toni.ruottu at iki.fi
Sat Oct 15 20:03:16 UTC 2022


I do not understand how negative indexing and search interact with each
other. I created a file that contains a single line with alphabets from "a"
to "z". It seems that after I have performed negative indexing, I can no
longer search reliably.

The search in the following magic does not work.

0       string          abc             abc
>-4     string          xyz             xyz
>0      search          opq             opq

However, the search does work if I reverse the order.

0       string          abc             abc
>0      search          opq             opq
>-4     string          xyz             xyz

Is this expected behaviour or have I encountered a bug?

  --Toni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20221015/0c756733/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broken_magic
Type: application/octet-stream
Size: 64 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20221015/0c756733/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alphabet
Type: application/octet-stream
Size: 27 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20221015/0c756733/attachment-0001.obj>


More information about the File mailing list