aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adjbacklight.12
-rw-r--r--adjbacklight.c10
-rwxr-xr-xtest.sh10
3 files changed, 11 insertions, 11 deletions
diff --git a/adjbacklight.1 b/adjbacklight.1
index f1ba575..6fbffce 100644
--- a/adjbacklight.1
+++ b/adjbacklight.1
@@ -29,7 +29,7 @@ be used inside
In fact it seems to work for all machines with backlight, which
is not true for
.BR xbacklight (1).
-.V adjbacklight
+.B adjbacklight
uses
.IR /sys/class/backlight .
.B adjbacklight
diff --git a/adjbacklight.c b/adjbacklight.c
index 80dd4a5..d79d11b 100644
--- a/adjbacklight.c
+++ b/adjbacklight.c
@@ -335,11 +335,11 @@ update(int argc, char *argv[], int all, int get, char *set, int set_prefix, doub
} else {
if ((dir = opendir(BACKLIGHT_DIR))) {
while ((ent = readdir(dir))) {
- if (all || strstr(ent->d_name, "acpi_video") == ent->d_name) {
- if (*ent->d_name && *ent->d_name != '.') {
- handle_device(ent->d_name, get, !!set, set_value, set_prefix == '+', set_suffix);
- any = 1;
- }
+ if (*ent->d_name && *ent->d_name != '.') {
+ handle_device(ent->d_name, get, !!set, set_value, set_prefix == '+', set_suffix);
+ any = 1;
+ if (!all)
+ break;
}
}
closedir(dir);
diff --git a/test.sh b/test.sh
index dd4cd06..51705d9 100755
--- a/test.sh
+++ b/test.sh
@@ -41,13 +41,13 @@ test $(./test -ga) = 40.00%
./test -s +20% dev
test $(./test -ga) = 60.00%
-mkdir .testdir/acpi_videox
-printf '%i\n' 50 > .testdir/acpi_videox/max_brightness
-printf '%i\n' 25 > .testdir/acpi_videox/brightness
+mkdir .testdir/acpi_video
+printf '%i\n' 50 > .testdir/acpi_video/max_brightness
+printf '%i\n' 25 > .testdir/acpi_video/brightness
-test $(./test -g) = 50.00%
+test $(./test -g acpi_video) = 50.00%
-rm -r .testdir/acpi_videox
+rm -r .testdir/acpi_video
printf '%s\n' 5 +15 -5 +20% | ./test dev
test $(./test -g dev) = 50.00%