chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] fix test regressions
[elogind.git]
/
namedev.c
diff --git
a/namedev.c
b/namedev.c
index 51a4639abe667a71fcfd2d92ea18f19b8c4df26c..b3a2a8ae4b0bcb2bf0eb62955d47f71bf57153d8 100644
(file)
--- a/
namedev.c
+++ b/
namedev.c
@@
-199,23
+199,21
@@
static void apply_format(struct udevice *udev, char *string, size_t maxsize,
struct sysfs_attribute *tmpattr;
pos = string;
struct sysfs_attribute *tmpattr;
pos = string;
-
while (1) {
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;
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);
attr = get_format_attribute(&tail);
+
switch (c) {
case 'b':
if (strlen(udev->bus_id) == 0)
switch (c) {
case 'b':
if (strlen(udev->bus_id) == 0)
@@
-286,6
+284,7
@@
static void apply_format(struct udevice *udev, char *string, size_t maxsize,
break;
case '%':
strfieldcatmax(string, "%", maxsize);
break;
case '%':
strfieldcatmax(string, "%", maxsize);
+ pos++;
break;
default:
dbg("unknown substitution type '%%%c'", c);
break;
default:
dbg("unknown substitution type '%%%c'", c);