summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3a0b657)
On Sat, Apr 17, 2004 at 03:30:29AM +0200, Kay Sievers wrote:
> On Sat, Apr 17, 2004 at 02:04:55AM +0200, Kay Sievers wrote:
> > On Fri, Apr 16, 2004 at 04:04:42PM -0700, Greg KH wrote:
> > > Oh, and if you run the latest udev_test.pl, we have a bunch more tests,
> > > including a few that fail, if you were looking for something to do :)
> >
> > Will do it. We need to change apply_format(). I tries to expand the '%%'
> > with the next iteration over the string and removes the '%'.
The tests are all successful now.
If this patch breaks something else, we simply have too few tests :)
struct sysfs_attribute *tmpattr;
pos = string;
struct sysfs_attribute *tmpattr;
pos = string;
- 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)
- }
- 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)
break;
case '%':
strfieldcatmax(string, "%", maxsize);
break;
case '%':
strfieldcatmax(string, "%", maxsize);
break;
default:
dbg("unknown substitution type '%%%c'", c);
break;
default:
dbg("unknown substitution type '%%%c'", c);