From eec005d9c263a303d62c5824d2439c42a52c58ad Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Fri, 8 Nov 2013 14:28:40 +0100 Subject: rename_device: remove comments and trailing whitespaces Cherry-picked from: 4632b2f3c067461ba7ab815affcca9ff7e3bf12c Resolves: #1220924 --- src/rename_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/rename_device.c') 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++; -- cgit v1.2.1