mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
Input: aiptek - tolerate newlines in sysfs files
Now echo "some value" > /sys/......./somefile is also acceptable. Signed-off-by: Rene van Paassen <rene.vanpaassen@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
b3b6cf1d47
commit
0112db36ef
1 changed files with 4 additions and 1 deletions
|
@ -375,8 +375,11 @@ static int map_str_to_val(const struct aiptek_map *map, const char *str, size_t
|
|||
{
|
||||
const struct aiptek_map *p;
|
||||
|
||||
if (str[count - 1] == '\n')
|
||||
count--;
|
||||
|
||||
for (p = map; p->string; p++)
|
||||
if (!strncmp(str, p->string, count))
|
||||
if (!strncmp(str, p->string, count))
|
||||
return p->value;
|
||||
|
||||
return AIPTEK_INVALID_VALUE;
|
||||
|
|
Loading…
Reference in a new issue