depend.awk: bugfix for commented out replacement text

This commit is contained in:
nhkeni
2024-03-13 22:04:19 -04:00
parent 31a8b44312
commit ab6d7cdc3b
2 changed files with 5 additions and 2 deletions

View File

@@ -250,6 +250,9 @@ function nhsort(list, first, last, cmpid, i,j,temp)
function nhcmp(a,b,cmpid)
{
if(cmpid == 0){ # sort dependencies
# commented out entry (there can be only one) MUST be last
if (a ~ /^#/){ return 1}
if (b ~ /^#/){ return 0}
# 2 .c or .cpp files
if (a ~ /\.c(pp)?$/ && b ~ /\.c(pp)?$/ ){ return a > b }
# a .c or .cpp file and anything else