aboutsummaryrefslogtreecommitdiffstats
path: root/monitor-edid
diff options
context:
space:
mode:
Diffstat (limited to 'monitor-edid')
-rwxr-xr-xmonitor-edid10
1 files changed, 9 insertions, 1 deletions
diff --git a/monitor-edid b/monitor-edid
index 1ba4d1c..8cbfb8d 100755
--- a/monitor-edid
+++ b/monitor-edid
@@ -61,7 +61,10 @@ sub parse_edid() {
sub get_edids {
my ($b_get_first) = @_;
- my @l = map { my $s = slurp($_); $s ? [ $_ => $s ] : () } get_edid_files();
+ my @l = map {
+ my $s = slurp($_);
+ is_edid_possibly_valid($s) ? [ $_ => $s ] : ();
+ } get_edid_files();
if (!@l || !$b_get_first && $< == 0) {
if (my $cmd = get_using_vbe()) {
@@ -95,6 +98,11 @@ sub find_EDID {
@l;
}
+sub is_edid_possibly_valid {
+ my ($edid) = @_;
+ length($edid) >= 128;
+}
+
sub slurp {
my ($f) = @_;
open(my $F, '<', $f) or return;