Skip to content

Commit

Permalink
main: deduplicate the code building sort command line
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Jul 22, 2023
1 parent 2af6f05 commit a491e8e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions main/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,12 @@ extern void externalSortTags (const bool toStdout, MIO *tagFile)
putenv (sortOrder1);
putenv (sortOrder2);
# endif
vStringCatS (cmd, sortCommand);
if (! toStdout)
{
vStringCatS (cmd, " -o ");
appendCstringWithQuotes (cmd, tagFileName ());
vStringPut (cmd, ' ');
appendCstringWithQuotes (cmd, tagFileName ());
}
#else
vStringCatS (cmd, sortOrder1);
vStringPut (cmd, ' ');
vStringCatS (cmd, sortOrder2);
vStringPut (cmd, ' ');
#endif
vStringCatS (cmd, sortCommand);
if (! toStdout)
{
Expand All @@ -130,7 +123,6 @@ extern void externalSortTags (const bool toStdout, MIO *tagFile)
vStringPut (cmd, ' ');
appendCstringWithQuotes (cmd, tagFileName ());
}
#endif
verbose ("system (\"%s\")\n", vStringValue (cmd));
if (toStdout)
{
Expand Down

0 comments on commit a491e8e

Please sign in to comment.