<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">It is not search that's broken. After the -4 offset the current file pointer is at <div class=""><br class=""></div><div class="">abcdefghijklmnopqrstuvwxyz</div><div class=""> ^</div><div class="">'x'.</div><div class=""><br class=""></div><div class="">so the search will start at xyz looking forward. You can view negative offsets as setting a new buffer starting point for the magic search.</div><div class=""><br class=""></div><div class="">christos<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 15, 2022, at 4:03 PM, Toni Ruottu <<a href="mailto:toni.ruottu@iki.fi" class="">toni.ruottu@iki.fi</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p class=""><defanged_div dir="ltr" class="">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.</defanged_div></p><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">The search in the following magic does not work.</defanged_div></p><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">0 string abc abc<br class="">>-4 string xyz xyz<br class="">>0 search opq opq<br class=""></defanged_div></p><defanged_div class=""><div class=""><br class="webkit-block-placeholder"></div><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">However, the search does work if I reverse the order.</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class="">0 string abc abc<br class="">>0 search opq opq<br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">>-4 string xyz xyz<br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class="">Is this expected behaviour or have I encountered a bug?</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""> --Toni</defanged_div></p><defanged_div class=""><p class=""><defanged_div class=""><br class=""></defanged_div></p><defanged_div class=""><div class=""><br class="webkit-block-placeholder"></div><defanged_div class="">
<span id="cid:DEFANGED-259"><broken_magic.DEFANGED-259></span><span id="cid:DEFANGED-260"><alphabet.DEFANGED-260></span>-- <br class="">File mailing list<br class=""><a href="mailto:File@astron.com" class="">File@astron.com</a><br class="">https://mailman.astron.com/mailman/listinfo/file<br class=""><span id="cid:446461F1-21D3-40FB-86B3-A47BFD3DE116"><sanitizer.log></span></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></div></blockquote></div><br class=""></div></body></html>