Commit 7690b413 authored by Bruce Momjian's avatar Bruce Momjian

Add backslashes to parentheses in awk regex because if not, they are

treated as regex groups.
parent 5bced8f5
......@@ -56,7 +56,7 @@ do
line1 !~ /^typedef/ &&
line1 !~ /^extern[ ][ ]*"C"/ &&
line1 !~ /=/ &&
line1 ~ /)/)
line1 ~ /\)/)
print "int pgindent_func_no_var_fix;";
line1 = line2;
}
......@@ -1688,16 +1688,16 @@ do
# like real functions.
awk ' BEGIN {paren_level = 0}
{
if ($0 ~ /^[a-zA-Z_][a-zA-Z_0-9]*[^(]*$/)
if ($0 ~ /^[a-zA-Z_][a-zA-Z_0-9]*[^\(]*$/)
{
saved_len = 0;
saved_lines[++saved_len] = $0;
if ((getline saved_lines[++saved_len]) == 0)
print saved_lines[1];
else
if (saved_lines[saved_len] !~ /^[a-zA-Z_][a-zA-Z_0-9]*(/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*(.*)$/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*(.*);$/)
if (saved_lines[saved_len] !~ /^[a-zA-Z_][a-zA-Z_0-9]*\(/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*\(.*\)$/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*\(.*\);$/)
{
print saved_lines[1];
print saved_lines[2];
......@@ -1714,7 +1714,7 @@ do
}
for (i=1; i <= saved_len; i++)
{
if (i == 1 && saved_lines[saved_len] ~ /);$/)
if (i == 1 && saved_lines[saved_len] ~ /\);$/)
{
printf "%s", saved_lines[i];
if (substr(saved_lines[i], length(saved_lines[i]),1) != "*")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment