summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2011-01-12 12:16:37 -0800
committerStig Thormodsrud <stig@vyatta.com>2011-01-12 12:19:40 -0800
commite495e3dab1062b776afa3313b88f333ab72259e2 (patch)
tree99e5f1d43df0043441138322c513c9a540b11834
parent660a9a474ac705a32548e736747e13674f94f3e5 (diff)
downloadvyatta-config-mgmt-e495e3dab1062b776afa3313b88f333ab72259e2.tar.gz
vyatta-config-mgmt-e495e3dab1062b776afa3313b88f333ab72259e2.zip
Fix 6674: Internal errors for "compare <> <>".
Add check for null diff. (cherry picked from commit 872f19b5b0890a494bda82eed9143338afaee5fe)
-rwxr-xr-xscripts/vyatta-config-mgmt.pl9
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;
}