diff -Nru a/namedev_parse.c b/namedev_parse.c --- a/namedev_parse.c Sun Feb 15 03:18:44 2004 +++ b/namedev_parse.c Sun Feb 15 03:18:44 2004 @@ -92,6 +92,7 @@ char *temp; char *temp2; char *temp3; + char *pos; FILE *fd; int program_given = 0; int retval = 0; @@ -150,7 +151,7 @@ continue; } - if (strncasecmp(temp2, FIELD_SYSFS, sizeof(FIELD_SYSFS)-1) == 0) { + if (strncasecmp(temp2, FIELD_SYSFS, sizeof(FIELD_SYSFS)-2) == 0) { struct sysfs_pair *pair = &dev.sysfs_pair[0]; int sysfs_pair_num = 0; @@ -164,8 +165,11 @@ ++pair; } if (pair) { - /* remove prepended 'SYSFS_' */ + /* extract file from 'SYSFS{file}' or 'SYSFS_file' */ strfieldcpy(pair->file, temp2 + sizeof(FIELD_SYSFS)-1); + pos = strchr(pair->file, '}'); + if (pos != NULL) + pos[0] = '\0'; strfieldcpy(pair->value, temp3); } continue; diff -Nru a/test/udev-test.pl b/test/udev-test.pl --- a/test/udev-test.pl Sun Feb 15 03:18:44 2004 +++ b/test/udev-test.pl Sun Feb 15 03:18:44 2004 @@ -194,6 +194,16 @@ EOF }, { + desc => "select sysfs attribute by SYFS{vendor}", + subsys => "block", + devpath => "block/sda", + expected => "disk-IBM-ESXS-sda" , + conf => < "sustitution of sysfs value (%s{file})", subsys => "block", devpath => "block/sda",