~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to erts/preloaded/src/erl_prim_loader.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-08-05 20:54:29 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090805205429-pm4pnwew8axraosl
Tags: 1:13.b.1-dfsg-5
* Fixed parentheses in Emacs mode (closes: #536891).
* Removed unnecessary conflicts with erlang-manpages package.
* Added workaround for #475459: disabled threads on sparc architecture.
  This breaks wxErlang, so it's only a temporary solution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
868
868
                {Res, PS};
869
869
            {archive, ArchiveFile, FileInArchive} ->
870
870
                debug(PS, {archive_get_file, ArchiveFile, FileInArchive}),
871
 
                FunnyFile = funny_split(FileInArchive, $/),
 
871
                FunnyFile = funny_split(FileInArchive),
872
872
                Fun =
873
873
                    fun({Funny, _GetInfo, GetBin}, Acc) ->
874
874
                            if
893
893
                {Res, PS};
894
894
            {archive, ArchiveFile, FileInArchive} ->
895
895
                debug(PS, {archive_list_dir, ArchiveFile, FileInArchive}),
896
 
                FunnyDir = funny_split(FileInArchive, $/),
 
896
                FunnyDir = funny_split(FileInArchive),
897
897
                Fun =
898
898
                    fun({Funny, _GetInfo, _GetBin}, {Status, Names} = Acc) ->
899
899
                            case Funny of
953
953
                end;
954
954
            {archive, ArchiveFile, FileInArchive} ->
955
955
                debug(PS, {archive_read_file_info, File}),
956
 
                FunnyFile = funny_split(FileInArchive, $/),
 
956
                FunnyFile = funny_split(FileInArchive),
957
957
                Fun =
958
958
                    fun({Funny, GetInfo, _GetBin}, Acc)  ->
959
959
                            if
1044
1044
    Wrapper =
1045
1045
        fun({N, GI, GB}, A) ->
1046
1046
                %% Ensure full iteration at open
1047
 
                Funny = funny_split(N, $/),
 
1047
                Funny = funny_split(N),
1048
1048
                {_Continue, A2} = Fun({Funny, GI, GB}, A),
1049
1049
                {true, {true, Funny}, A2}
1050
1050
        end,
1147
1147
    lists:reverse(L, [B, A]). % BIF
1148
1148
                        
1149
1149
%% Returns all lists in reverse order
1150
 
funny_split(List, Sep) ->
1151
 
   funny_split(List, Sep, [], []).
 
1150
funny_split(List) ->
 
1151
   funny_split(List, [], []).
1152
1152
 
1153
 
funny_split([Sep | Tail], Sep, Path, Paths) ->
1154
 
    funny_split(Tail, Sep, [], [Path | Paths]);
1155
 
funny_split([Head | Tail], Sep, Path, Paths) ->
1156
 
    funny_split(Tail, Sep, [Head | Path], Paths);
1157
 
funny_split([], _Sep, Path, Paths) ->
 
1153
funny_split([Sep | Tail], Path, Paths) when Sep =:= $/; Sep =:= $\\->
 
1154
    funny_split(Tail, [], [Path | Paths]);
 
1155
funny_split([Head | Tail], Path, Paths) ->
 
1156
    funny_split(Tail, [Head | Path], Paths);
 
1157
funny_split([], Path, Paths) ->
1158
1158
    [Path | Paths].
1159
1159
 
1160
1160
name_split(ArchiveFile, File0) ->
1171
1171
            %% Top dir in archive
1172
1172
            ArchiveFile = reverse(RevArchiveFile),
1173
1173
            {archive, ArchiveFile, []};
1174
 
        {split, _RevArchiveBase, RevArchiveFile, [$/ | FileInArchive]} ->
 
1174
        {split, _RevArchiveBase, RevArchiveFile, [Sep | FileInArchive]} 
 
1175
        when Sep =:= $/; Sep =:= $\\ ->
1175
1176
            %% File in archive
1176
1177
            ArchiveFile = reverse(RevArchiveFile),
1177
1178
            {archive, ArchiveFile, FileInArchive};
1189
1190
        {match, _RevPrimArchiveFile, FileInArchive} ->
1190
1191
            %% Primary archive
1191
1192
            case FileInArchive of
1192
 
                [$/ | FileInArchive2] ->
 
1193
                [Sep | FileInArchive2] when Sep =:= $/; Sep =:= $\\ ->
1193
1194
                    {archive, ArchiveFile, FileInArchive2};
1194
1195
                _ ->
1195
1196
                    {archive, ArchiveFile, FileInArchive}