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:19:40 -0800 |
commit | e495e3dab1062b776afa3313b88f333ab72259e2 (patch) | |
tree | 99e5f1d43df0043441138322c513c9a540b11834 | |
parent | 660a9a474ac705a32548e736747e13674f94f3e5 (diff) | |
download | vyatta-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-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; } |