Permalink
Browse files

Merge pull request #2 from davidjulien/master

Fix a bug in remove_positions
  • Loading branch information...
2 parents d3078a6 + 548db65 commit 98ec511e05e1406a6c41a41f378e3e1b6b41b851 @retnuh committed Jul 29, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/mochiweb_xpath.erl
View
@@ -320,10 +320,10 @@ add_positions_aux(Data, _) ->
%% @doc Remove position from each node
%% @spec remove_positions(ExtendedDoc) -> Doc
%% @type ExtendedDoc = {atom(), [{binary(), any()}], [extended_node()], [non_neg_integer()]}
-remove_positions([_|_] = Nodes) ->
+remove_positions(Nodes) when is_list(Nodes) ->
[ remove_positions(SubNode) || SubNode <- Nodes ];
remove_positions({Tag, Attrs, Children, _}) ->
- {Tag, Attrs, Children};
+ {Tag, Attrs, remove_positions(Children)};
remove_positions(Data) ->
Data.

0 comments on commit 98ec511

Please sign in to comment.