]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Correctly check return value of getline
authorRuediger Pluem <rpluem@apache.org>
Wed, 4 Jun 2025 09:16:24 +0000 (09:16 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 4 Jun 2025 09:16:24 +0000 (09:16 +0000)
In case of an error (e.g. file not found or readable) getline returns -1 which
causes an endless loop. Leave the loop in such cases.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926110 13f79535-47bb-0310-9956-ffa450edef68

Makefile.in

index e4961561b159bd22a034dd9d8383b5e163bc049a..b5f86a9752c0ff575015bfa8d04a7e8dec8c5a04 100644 (file)
@@ -171,7 +171,7 @@ update-changes:
            cp CHANGES CHANGES.tmp ; \
            awk -v fname=$$i 'BEGIN{done = 0; active = 0} \
                            done == 0 && active == 0 && /^Changes with Apache /{ active = 1; print; next}; \
-                           /^( *\*|Changes with Apache )/ && active == 1 && done == 0{rec=$$0; while(getline<fname){if (! ($$0 ~ /^ *$$/)){print}}printf "\n";print rec; active = 0; done = 1; next} //;' \
+                           /^( *\*|Changes with Apache )/ && active == 1 && done == 0{rec=$$0; while((getline<fname) > 0){if (! ($$0 ~ /^ *$$/)){print}}printf "\n";print rec; active = 0; done = 1; next} //;' \
            CHANGES.tmp > CHANGES ; \
            rm CHANGES.tmp ; \
            if [ -n "$(SVN)" ] ; then \