diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2011-01-12 12:16:37 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2011-01-12 12:16:37 -0800 |
commit | 872f19b5b0890a494bda82eed9143338afaee5fe (patch) | |
tree | f942fbfc5013540db7537d7954386cf6c0b73450 | |
parent | bfe63f885111105c5f8e2dbf25ef9444b05db239 (diff) | |
download | vyatta-config-mgmt-872f19b5b0890a494bda82eed9143338afaee5fe.tar.gz vyatta-config-mgmt-872f19b5b0890a494bda82eed9143338afaee5fe.zip |
Fix 6674: Internal errors for "compare <> <>".
Add check for null diff.
-rwxr-xr-x | scripts/vyatta-config-mgmt.pl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/vyatta-config-mgmt.pl b/scripts/vyatta-config-mgmt.pl index 5bd1b03..58f517c 100755 --- a/scripts/vyatta-config-mgmt.pl +++ b/scripts/vyatta-config-mgmt.pl @@ -310,8 +310,13 @@ if ($action eq 'diff') { my $filename = cm_commit_get_file_name($rev1); my $filename2 = cm_commit_get_file_name($rev2); my $diff = `zdiff -u $filename2 $filename`; - $diff = filter_file_lines($diff); - print "$diff\n"; + if (defined $diff and length($diff) > 0) { + $diff = filter_file_lines($diff); + print "$diff\n"; + } else { + print "No changes between revision $rev1 and " + . "revision $rev2 configurations\n"; + } } exit 0; } |