struct sysfs_attribute *tmpattr;
pos = string;
-
while (1) {
- pos = strchr(string, '%');
- if (pos != NULL) {
- pos[0] = '\0';
- tail = pos+1;
- len = get_format_len(&tail);
- c = tail[0];
- strfieldcpy(temp, tail+1);
- tail = temp;
- } else {
+ pos = strchr(pos, '%');
+ if (pos == NULL)
break;
- }
- dbg("format=%c, string='%s', tail='%s'",c , string, tail);
+ pos[0] = '\0';
+ tail = pos+1;
+ len = get_format_len(&tail);
+ c = tail[0];
+ strfieldcpy(temp, tail+1);
+ tail = temp;
+ dbg("format=%c, string='%s', tail='%s'",c , string, tail);
attr = get_format_attribute(&tail);
+
switch (c) {
case 'b':
if (strlen(udev->bus_id) == 0)
break;
case '%':
strfieldcatmax(string, "%", maxsize);
+ pos++;
break;
default:
dbg("unknown substitution type '%%%c'", c);