anchor.diff:  	end.
   %% @hidden
   patch_user1(ID, Etag, CType, ReqBody) ->
  -	{Port, Address, Directory, _} = get_params(),
   	try
   		{array, Ops} = mochijson:decode(ReqBody),
  -		Characteristics = process_json_patch(Ops),
  -		{_, Username} = lists:keyfind("username", 1, Characteristics),
  -		{_, Password} = lists:keyfind("password", 1, Characteristics),
  -		{_, Locale} = lists:keyfind("locale", 1, Characteristics),
  -		case mod_auth:get_user(ID, Address, Port, Directory) of
  -			{ok, #httpd_user{user_data = UserData}} ->
  -				{_, LM} = lists:keyfind(last_modified, 1, UserData),
  +		case process_json_patch(Ops, ID) of
  +			{error, Code} ->
  +				{error, Code};
  +			{Username, Password, Locale, LM} ->
   				case LM of
   					Etag ->
   						patch_user3(ID, CType, Username, Password, Locale);
   					_ ->
   						{error, 412}
  -				end;
  -			{error, no_such_user} ->
  -				{error, 404};
  -			{error, _Reason} ->
  -				{error, 500}
  +				end
   		end
   	catch
   		_:_ ->
  
positive.code: 			{_, "add"} = lists:keyfind("op", 1, A1),
  			{_, "/characteristic/-/value"} = lists:keyfind("path", 1, A1),
  			{_, V1} = lists:keyfind("value", 1, A1),
  			process_json_patch1(T1, [{V, V1} | Acc]);
  		"value" ->
  			{error, 400}
  	end;
  process_json_patch1([], Acc) ->
  	Acc.
  
  
negative.code: 	{TS, N} = V,
  	integer_to_list(TS) ++ "-" ++ integer_to_list(N).
  
  -spec process_json_patch(Operations, ID) -> Result
  	when
  		Operations :: [{struct, OpObject}],
  		ID :: string(),
  		OpObject :: [{Key, Value}],
  		Key :: term(),
  		Value :: term(),
  		Result :: {Username, Password, Locale, LastModified} | {error, Code},
  		Username :: string(),
  		Password :: string(),
  		Locale :: string(),
  		LastModified :: {integer(), integer()},
  		Code :: integer().
  %% @doc Process a json-patch document and return list of characteristics
  %% for a user .
  %% @hidden
  process_json_patch(Ops, ID) ->
  	process_json_patch1(Ops, ID, []).
  %% @hidden
  process_json_patch1([{struct, Attr}| T], ID, Acc) ->
  	{_, "add"} = lists:keyfind("op", 1, Attr),
  	{_, "/characteristic/-/" ++ A} = lists:keyfind("path", 1, Attr),
  	{_, V} = lists:keyfind("value", 1, Attr),
  