diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-11-25 01:25:04 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-11-25 01:25:04 +0000 |
commit | 86aac04128133728a2fddf5627ac840fe520b71f (patch) | |
tree | 55704c0b5944d312dfbf0d4df870d650545cb31c /ext | |
parent | 7f17c43dab3a257d040ab66617b98c7f1cafc2b8 (diff) | |
download | unicorn-86aac04128133728a2fddf5627ac840fe520b71f.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@408 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'ext')
-rw-r--r-- | ext/http11/http11.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/http11/http11.c b/ext/http11/http11.c index ef51ebb..0d2c79a 100644 --- a/ext/http11/http11.c +++ b/ext/http11/http11.c @@ -299,9 +299,6 @@ VALUE BMHSearch_find(VALUE self, VALUE hay) rb_raise(eBMHSearchError, "Corrupt search state. REALLY BAD!"); } - /* Start searching from the end of S->needle (this is not a typo) */ - hpos = S->nlen-1; - /* Check for a trailing remainder, which is only possible if skip > 1 */ if(S->skip) { // only scan for what should be the rest of the string @@ -315,6 +312,9 @@ VALUE BMHSearch_find(VALUE self, VALUE hay) } + /* Start searching from the end of S->needle (this is not a typo) */ + hpos = S->nlen-1; + while(hpos < hlen) { /* Compare the S->needle backwards, and stop when first mismatch is found */ npos = S->nlen-1; |