aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-11-08 14:28:40 +0100
committerLukas Nykryn <lnykryn@redhat.com>2013-11-12 12:24:41 +0100
commit4632b2f3c067461ba7ab815affcca9ff7e3bf12c (patch)
tree0ef83e679046013e9396a6ad8877c0217aa6bcf1
parent3f42f2f0888808f6e631b962fd0c92275c701d1d (diff)
downloadinitscripts-4632b2f3c067461ba7ab815affcca9ff7e3bf12c.tar
initscripts-4632b2f3c067461ba7ab815affcca9ff7e3bf12c.tar.gz
initscripts-4632b2f3c067461ba7ab815affcca9ff7e3bf12c.tar.bz2
initscripts-4632b2f3c067461ba7ab815affcca9ff7e3bf12c.tar.xz
initscripts-4632b2f3c067461ba7ab815affcca9ff7e3bf12c.zip
rename_device: remove comments and trailing whitespaces
-rw-r--r--src/rename_device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rename_device.c b/src/rename_device.c
index 8e28154d..bb5e6b8f 100644
--- a/src/rename_device.c
+++ b/src/rename_device.c
@@ -120,6 +120,14 @@ int isCfg(const struct dirent *dent) {
}
static inline char *dequote(char *start, char *end) {
+ char *c;
+ //remove comments and trailing whitespace
+ c = strchr(start, '#');
+ if (c!=NULL)
+ *c='\0';
+
+ g_strchomp(start);
+
if (end==NULL) {
end=start;
while(*end) end++;