Permalink
Browse files

Don't use binary module, so eredis can be compatible with R13B04

  • Loading branch information...
tomlion committed Jul 25, 2011
1 parent f706273 commit e777940073d449b069d8f27492035536584205ad
Showing with 8 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +7 −6 src/eredis_parser.erl
View
@@ -0,0 +1 @@
+ebin/*
View
@@ -249,12 +249,13 @@ parse_simple({incomplete_simple, OldData}, NewData0) ->
%%
get_newline_pos(B) ->
- case binary:match(B, <<?NL>>) of
- {Pos, _} ->
- Pos;
- nomatch ->
- undefined
- end.
+ [H|_] = re:split(B, ?NL),
+ Pos = size(H),
+ case Pos =:= size(B) of
+ true -> undefined;
+ false -> Pos
+ end.
+
%% @doc: Helper for handling the result of parsing. Will update the
%% parser state with the continuation of given name if necessary.

0 comments on commit e777940

Please sign in to comment.