From bf8cf1483f6784f06fd28b084253f3fc5406e24c Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Sat, 10 Dec 2011 19:45:37 -0200 Subject: [PATCH] fix string replace. configure files with this would fail: options wl x=1 were being handled as " =1". --- libkmod/libkmod-util.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c index 2e58c91e..9a68a3e2 100644 --- a/libkmod/libkmod-util.c +++ b/libkmod/libkmod-util.c @@ -208,10 +208,9 @@ int read_str_ulong(int fd, unsigned long *value, int base) { char *strchr_replace(char *s, int c, char r) { char *p; - - for (p = s; p != NULL; p = strchr(p, c)) - *p = r; - + for (p = s; *p != '\0'; p++) + if (*p == c) + *p = r; return s; } -- 2.47.2