# $Id$
BEGIN {
- if ( ! infile ) {
+ if (!infile) {
print "infile= must be specified" > "/dev/stderr"
exit 1
}
file = ""
- while ( getline < infile ) {
+ while ((rc = getline < infile) > 0) {
name = ""
- if ( match( $0, /^# CONFIG_[A-Za-z0-9_]+ is not set$/ ) ) {
+ if ( match($0, /^# CONFIG_[A-Za-z0-9_]+ is not set$/)) {
name = $2
value = "n"
- } else if ( match( $0, /^CONFIG_[A-Za-z0-9_]+=/ ) ) {
+ } else if (match($0, /^CONFIG_[A-Za-z0-9_]+=/)) {
name = value = $1
- sub( /=.*$/, "", name )
- sub( /^[^=]*=/, "", value )
- } else if ( match( $0, /^# file:/ ) ) {
+ sub(/=.*$/, "", name)
+ sub(/^[^=]*=/, "", value)
+ } else if (match($0, /^# file:/)) {
file = $3
}
- if ( length( name ) ) {
- optionArray[ name ] = value
- optionFile[ name ] = file
+ if (length(name)) {
+ optionArray[name] = value
+ optionFile[name] = file
}
}
+ if (rc == -1) {
+ printf("Error reading infile='%s'\n", infile) > "/dev/stderr"
+ exit 1
+ }
foundErrors = 0
}