Skip to content

Commit

Permalink
Fix entity sorting
Browse files Browse the repository at this point in the history
Remove trailing semicolon from function entities and add them after sorting. Previously, sorting entities with trailing semicolons would result in functions not being in a natural order (e.g. curl_setopt_array would come before curl_setopt because curl_setopt; comes before curl_setopt_array;).
  • Loading branch information
haszi committed Jul 20, 2024
1 parent d5ecfd2 commit 8476196
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/file-entities.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function file_entities($work_dir, $trans_dir, $orig_dir, &$entities, $prefix=fal
// If this is a functions directory, collect it into
// the special $function_entities array
if (isset($function_entities)) {
$function_entities[] = "&$name;";
$function_entities[] = "&$name";
}

// If we have a translated file, use it, otherwise fall back to English
Expand Down Expand Up @@ -229,7 +229,7 @@ function file_entities($work_dir, $trans_dir, $orig_dir, &$entities, $prefix=fal
// Write out all entities with newlines
$fp = fopen($functions_file, "w");
foreach ($function_entities as $entity) {
fputs($fp, "$entity\n");
fputs($fp, "$entity;\n");
}
fclose($fp);
}
Expand Down

0 comments on commit 8476196

Please sign in to comment.