summaryrefslogtreecommitdiff
path: root/bin/MakeProjectCreator/modules/WorkspaceCreator.pm
diff options
context:
space:
mode:
Diffstat (limited to 'bin/MakeProjectCreator/modules/WorkspaceCreator.pm')
-rw-r--r--bin/MakeProjectCreator/modules/WorkspaceCreator.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/MakeProjectCreator/modules/WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm
index b2f7cf1f1d4..93228a55f3d 100644
--- a/bin/MakeProjectCreator/modules/WorkspaceCreator.pm
+++ b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm
@@ -763,9 +763,15 @@ sub sort_dependencies {
## See if the dependency is listed after this project
for(my $j = $i; $j <= $#list; $j++) {
if ($list[$j] eq $full && $i != $j) {
- ## If so, move it in front of the current project
- splice(@list, $i, 0, $full);
- splice(@list, $j + 1, 1);
+ ## If so, move it in front of the current project.
+ ## The original code, which had splices, didn't always
+ ## work correctly (especially on AIX for some reason).
+ for(my $k = $j; $k > $i; --$k) {
+ $list[$k] = $list[$k - 1];
+ }
+ $list[$i] = $full;
+
+ ## Mark that an entry has been moved
$moved = 1;
$j--;
}