diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2013-11-08 14:28:40 +0100 |
---|---|---|
committer | Lukas Nykryn <lnykryn@redhat.com> | 2015-10-27 16:31:45 +0100 |
commit | eec005d9c263a303d62c5824d2439c42a52c58ad (patch) | |
tree | 0d06bb54a726244d0653a678713a2184d669c637 | |
parent | fe0c798544c45f97779def824a2dc55cfcc49e56 (diff) | |
download | initscripts-eec005d9c263a303d62c5824d2439c42a52c58ad.tar initscripts-eec005d9c263a303d62c5824d2439c42a52c58ad.tar.gz initscripts-eec005d9c263a303d62c5824d2439c42a52c58ad.tar.bz2 initscripts-eec005d9c263a303d62c5824d2439c42a52c58ad.tar.xz initscripts-eec005d9c263a303d62c5824d2439c42a52c58ad.zip |
rename_device: remove comments and trailing whitespaces
Cherry-picked from: 4632b2f3c067461ba7ab815affcca9ff7e3bf12c
Resolves: #1220924
-rw-r--r-- | src/rename_device.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rename_device.c b/src/rename_device.c index f96291b0..f8cfd391 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++; |