From dd05ad66055f636aba524cab72013d2fe344d08b Mon Sep 17 00:00:00 2001 From: elliott_c Date: Thu, 7 Aug 2003 12:36:33 +0000 Subject: ChangeLogTag: Thu Aug 7 07:35:56 2003 Chad Elliott --- ChangeLog | 7 +++++++ bin/MakeProjectCreator/modules/WorkspaceCreator.pm | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98f0521f7bf..55daae5eeec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Aug 7 07:35:56 2003 Chad Elliott + + * bin/MakeProjectCreator/modules/WorkspaceCreator.pm: + + Corrected a bug in the dependency sorting logic by removing the + use of splice and manually moving the array entries. + Thu Aug 7 06:18:57 2003 Chad Elliott * include/makeinclude/rules.local.GNU: 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--; } -- cgit v1.2.1