Additional empty output lines do not matter for the generated C code or
the function declarations in the header files. However, a subsequent
commit changes command_util.sh to generate a preprocessor macro for
the header file, and there we can not afford empty lines unless they
end with a backslash to continue the line.
This patch makes sure that no superfluous newlines are printed in
the output.
for source_file in $source_files; do
match=$(grep "^\(__noreturn \)*int com_$name_txt(" $source_file | head -n 1 | sed -e 's/$/;/1')
if test -n "$match"; then
for source_file in $source_files; do
match=$(grep "^\(__noreturn \)*int com_$name_txt(" $source_file | head -n 1 | sed -e 's/$/;/1')
if test -n "$match"; then
- result="$result $match$CR"
+ result="$result$match$CR"
- result=" {.name = \"$name_txt\", .completer = ${name_txt}_completer}, \\"
+ local CR='
+'
+ result=" {.name = \"$name_txt\", .completer = ${name_txt}_completer}, \\$CR"
local t_name="$name_txt"
local t_perms="$perms_txt"
local t_desc="$desc_txt"
local t_name="$name_txt"
local t_perms="$perms_txt"
local t_desc="$desc_txt"
usage_txt=$(echo "$t_usage" | $sed_cmd)
help_txt=$(printf "%s\n" "$t_help" | $sed_cmd)
prototype=$(echo "$template_prototype" | $sed_cmd)
usage_txt=$(echo "$t_usage" | $sed_cmd)
help_txt=$(printf "%s\n" "$t_help" | $sed_cmd)
prototype=$(echo "$template_prototype" | $sed_cmd)
+ loop_result="$loop_result$result"
fi
if test $template -eq 0; then
make_array_member
fi
if test $template -eq 0; then
make_array_member
continue
fi
template_loop make_array_member
continue
fi
template_loop make_array_member
done
echo '{.name = NULL}};'
}
done
echo '{.name = NULL}};'
}
fi
if test $template -eq 0; then
make_proto
fi
if test $template -eq 0; then
make_proto
continue
fi
template_loop make_proto
continue
fi
template_loop make_proto
fi
if test $template -eq 0; then
make_completion
fi
if test $template -eq 0; then
make_completion
continue
fi
template_loop make_completion
continue
fi
template_loop make_completion