Skip to content

Commit 5fce534

Browse files
haszihaszi
andauthored
Fix entity sorting (#134)
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;). Co-authored-by: haszi <[email protected]>
1 parent 5e83026 commit 5fce534

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/file-entities.php.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function file_entities($work_dir, $trans_dir, $orig_dir, &$entities, $prefix=fal
200200
// If this is a functions directory, collect it into
201201
// the special $function_entities array
202202
if (isset($function_entities)) {
203-
$function_entities[] = "&$name;";
203+
$function_entities[] = "&$name";
204204
}
205205

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

0 commit comments

Comments
 (0)