From 35b512f079cc0fb699bcb653bca0edd28ddf29e9 Mon Sep 17 00:00:00 2001
From: "mwagner@here.mwagner.org" <>
Date: Wed, 30 Jun 2004 23:29:47 -0500
Subject: [PATCH] mysql-copyright:   Fix for the condition when "the_fat"
 doesn't end with 'dnl\n', but ')\n'.

---
 Build-tools/mysql-copyright | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright
index f2da3cdf447..e1ee513e06d 100755
--- a/Build-tools/mysql-copyright
+++ b/Build-tools/mysql-copyright
@@ -162,7 +162,23 @@ sub trim_the_fat
                 undef $/;
                 my $configure= <CONFIGURE>;
                 close(CONFIGURE);
-                $configure=~ s|${the_fat}/Makefile dnl\n?||g;
+
+                #
+                # If $the_fat Makefile line closes the parenthesis, then
+                # replace that line with just the closing parenthesis.
+                #
+                if ($configure=~ m|${the_fat}/Makefile\)\n?|)
+                {
+                        $configure=~ s|${the_fat}/Makefile(\)\n?)|$1|;
+                }
+                #
+                # Else just delete the line
+                #
+                else
+                {
+                        $configure=~ s|${the_fat}/Makefile dnl\n?||;
+                }
+
                 open(CONFIGURE,">configure.in") or die "Unable to open configure.in for write: $!\n";
                 print CONFIGURE $configure;
                 close(CONFIGURE);
-- 
2.30.9