anchor.diff:  	[] ->
   	    reverse(Acc)
       end.
  +
  +%% Remove .. and . from the path, e.g.
  +%% /path/./to/this/../file -> /path/to/file
  +path_flatten(Name) ->
  +    path_flatten(Name,[],[]).
  +
  +path_flatten([$/,$.,$.,$/|Rest],_RevLast,RevTop) ->
  +    path_flatten(Rest,[],RevTop);
  +path_flatten([$/,$.,$/|Rest],RevLast,RevTop) ->
  +    path_flatten([$/|Rest],RevLast,RevTop);
  +path_flatten([$/,$.,$.],_RevLast,RevTop) ->
  +    path_flatten([],[],RevTop);
  +path_flatten([$/,$.],RevLast,RevTop) ->
  +    path_flatten([],RevLast,RevTop);
  +path_flatten([$/],RevLast,RevTop) ->
  +    path_flatten([],RevLast,RevTop);
  +path_flatten([$/|Rest],RevLast,RevTop) ->
  +    path_flatten(Rest,[],[$/|RevLast++RevTop]);
  +path_flatten([Ch|Rest],RevLast,RevTop) ->
  +    path_flatten(Rest,[Ch|RevLast],RevTop);
  +path_flatten([],RevLast,RevTop) ->
  +    reverse(RevLast++RevTop).
  
positive.code: 	    %% False match. Assume plain file
              {file, File}
      end;
  do_name_split(ArchiveFile0, File) ->
      %% Look first in primary archive
      ArchiveFile = absname(ArchiveFile0),
      case string_match(File, ArchiveFile, []) of
          no_match ->
              %% Archive or plain file
              do_name_split(undefined, File);
          {match, _RevPrimArchiveFile, FileInArchive} ->
              %% Primary archive
              case FileInArchive of
                  [$/ | FileInArchive2] ->
                      {archive, ArchiveFile, FileInArchive2};
                  _ ->
                      {archive, ArchiveFile, FileInArchive}
              end
      end.
  
  string_match([Char | File], [Char | Archive], RevTop) ->
      string_match(File, Archive, [Char | RevTop]);
  string_match(File, [], RevTop) ->
      {match, RevTop, File};
  string_match(_File, _Archive, _RevTop) ->
      no_match.
  
negative.code:             debug(PS2, {return, Res}),
              {Res, PS2}
      end;
  prim_set_primary_archive(PS, ArchiveFile0, ArchiveBin, #file_info{} = FileInfo)
    when is_list(ArchiveFile0), is_binary(ArchiveBin) ->
      %% Try the archive file
      debug(PS, {set_primary_archive, ArchiveFile0, byte_size(ArchiveBin)}),
      ArchiveFile = absname(ArchiveFile0),
      {Res3, PS3} =
          case PS#prim_state.primary_archive of
              undefined ->
  