Bugzilla – Bug 4070
Bug in implementation of native function strfind
Last modified: 2014-02-08 23:51:43 PST
Created attachment 1768 [details] [review] Proposed patch As per documentaion: " Syntax: strfind ( const string[], const sub[], ignorecase=0, pos=0 ) " there is parameter "pos". Which mean, I hope, that searching should start not from first char but from specified position. But this doesn't work, i.e. searching is always starts from 0. Proposed patch is attached. I doesn't check it by compilation, so testing is recommended.
What are you using to generate diffs, out of curiosity? There is no context in the patch so it doesn't apply.
I used ExamDiff Pro to compare files. It has feature to generate unix diff file. To generate diff with context I think I have to chekout amxx from svn. But I doesn't know where it is. So I simply use archived sources.
Or give me an example of patch with context and I will add context to mine patches by hands.
Use an SVN client - our URL is svn://svn.alliedmods.net/svnroot/amxmodx/trunk From the command line: svn checkout svn://svn.alliedmods.net/svnroot/amxmodx/trunk amxmodx You can use the "svn diff" command to generate patches. There are also GUI svn clients if you don't like using command lines.
Created attachment 1769 [details] [review] Proposed patch 2 Is this file format is good for you?
Comment on attachment 1769 [details] [review] Proposed patch 2 Much better, thanks!
This one needs checkin.
Created attachment 2487 [details] [review] Corrected proposed path The previous patch is not entirely correct. This patch fix it by removing the change in the "return". Compiled and tested successfully. Here a small plugin used to test and to confirm it works as expected : http://pastebin.com/D05KCv7h
Given a quick analysis of plugins on the forums, it looks like this will not introduce any binary or source compatibility problems. Will take for 1.8.2. Thanks for the patch!
Pushed changeset: http://hg.alliedmods.net/amxmodx-central/rev/5bdea6a3364d Changelog: Fix strfind ignoring its last parameter (bug 4070, r=dvander).
Commit pushed to master at https://github.com/alliedmodders/amxmodx https://github.com/alliedmodders/amxmodx/commit/8793d8f8d5b9cd7b311f7a4362bc18acbdb8e369 Fix strfind ignoring its last parameter (bug 4070, r=dvander). Former-commit-id: a31621dd0c08c7bbede41a06d0ebf8abab1b66a5