diff options
author | Bill Nottingham <notting@redhat.com> | 2008-01-09 21:08:47 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2008-01-09 21:08:47 +0000 |
commit | 935195cfaee504a0b61afaf53b78a92d9bf0f026 (patch) | |
tree | 87320c211a07e4d546c1890aef336661eeeef884 /src/rename_device.c | |
parent | e64f509e445d7b1835e247136664cf91bc27866d (diff) | |
download | initscripts-935195cfaee504a0b61afaf53b78a92d9bf0f026.tar initscripts-935195cfaee504a0b61afaf53b78a92d9bf0f026.tar.gz initscripts-935195cfaee504a0b61afaf53b78a92d9bf0f026.tar.bz2 initscripts-935195cfaee504a0b61afaf53b78a92d9bf0f026.tar.xz initscripts-935195cfaee504a0b61afaf53b78a92d9bf0f026.zip |
add patch from rhel5 (#351291)
Diffstat (limited to 'src/rename_device.c')
-rw-r--r-- | src/rename_device.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/rename_device.c b/src/rename_device.c index 7b3b3699..f7fc1d36 100644 --- a/src/rename_device.c +++ b/src/rename_device.c @@ -170,6 +170,19 @@ int isCfg(const struct dirent *dent) { return 1; } +static inline char *dequote(char *start, char *end) { + if (end==NULL) { + end=start; + while(*end) end++; + } + if (end > start) end--; + if ((*start == '\'' || *start == '\"') && ( *start == *end ) ) { + *end='\0'; + if (start<end) start++; + } + return start; +} + struct netdev *get_configs() { int ncfgs = 0; struct netdev *ret, *tmpdev; @@ -206,11 +219,11 @@ struct netdev *get_configs() { } #if defined(__s390__) || defined(__s390x__) if (g_str_has_prefix(lines[i],"SUBCHANNELS=")) { - hwaddr = lines[i] + 12; + hwaddr = dequote(lines[i] + 12, NULL); } #else if (g_str_has_prefix(lines[i],"HWADDR=")) { - hwaddr = lines[i] + 7; + hwaddr = dequote(lines[i] + 7, NULL); } #endif } |