--- dch.old	2005-01-02 10:05:21.000000000 +0000
+++ dch	2005-01-02 10:31:01.000000000 +0000
@@ -30,6 +30,7 @@
 #
 # Originally by Christoph Lameter <clameter@debian.org>
 # Modified extensively by Julian Gilbey <jdg@debian.org>
+# Minor changes by Chris Anderson <chris@nullcode.org>
 #
 # Copyright 1999-2003 by Julian Gilbey 
 #
@@ -73,6 +74,8 @@
          Increase the Debian release number, adding a new changelog entry
   -a, --append
          Append a new entry to the current changelog
+  -c, --control
+         Obtain name and email from the Maintainer field of debian/control
   -v <version>, --newversion=<version>
          Add a new changelog entry with version number specified
   --closes nnnnn[,nnnnn,...]
@@ -187,7 +190,7 @@
 # We use bundling so that the short option behaviour is the same as
 # with older debchange versions.
 my ($opt_help, $opt_version);
-my ($opt_i, $opt_a, $opt_v, $opt_d, $opt_D, $opt_u, $opt_n, @closes);
+my ($opt_i, $opt_a, $opt_c, $opt_v, $opt_d, $opt_D, $opt_u, $opt_n, @closes);
 my ($opt_ignore, $opt_level, $opt_regex, $opt_noconf);
 $opt_u = 'low';
 
@@ -196,6 +199,7 @@
 	   "version" => \$opt_version,
 	   "i|increment" => \$opt_i,
 	   "a|append" => \$opt_a,
+           "c|control" => \$opt_c, 
 	   "v|newversion=s" => \$opt_v,
 	   "d|fromdirname" => \$opt_d,
 	   "p" => \$opt_p,
@@ -344,17 +348,33 @@
 check_env_utf8('DEBEMAIL');
 check_env_utf8('EMAIL');
 
-if (exists $env{'DEBEMAIL'} and $env{'DEBEMAIL'} =~ /^(.*)\s+<(.*)>$/) {
+if (exists $env{'DEBEMAIL'} and $env{'DEBEMAIL'} =~ /^(.*)\s+<(.*)>$/ and ! defined $opt_c) {
     $env{'DEBFULLNAME'} = $1 unless exists $env{'DEBFULLNAME'};
     $env{'DEBEMAIL'} = $2;
 }
-if (! exists $env{'DEBEMAIL'} or ! exists $env{'DEBFULLNAME'}) {
+if (! exists $env{'DEBEMAIL'} or ! exists $env{'DEBFULLNAME'} and ! defined $opt_c) {
     if (exists $env{'EMAIL'} and $env{'EMAIL'} =~ /^(.*)\s+<(.*)>$/) {
 	$env{'DEBFULLNAME'} = $1 unless exists $env{'DEBFULLNAME'};
 	$env{'EMAIL'} = $2;
     }
 }
 
+if (defined $opt_c) {
+    # The chdir earlier for the changelog should ensure control is at debian/control
+    if ( ! -r 'debian/control' ) {
+        die "$progname: Cannot read debian/control\nIs it in the right directory?\n";
+    }
+        
+    open CONTROL, 'debian/control';
+    while (<CONTROL>) {
+        if (/^Maintainer:\s*(.*)\s+<(.*)>\s*$/) {
+            $env{'DEBFULLNAME'} = $1;
+            $env{'DEBEMAIL'} = $2;
+        }
+    }
+    close CONTROL;
+}
+
 # Now use the gleaned values to detemine our MAINTAINER and EMAIL values
 if (exists $env{'DEBFULLNAME'}) {
     $MAINTAINER = $env{'DEBFULLNAME'};
