Merge branch 'master' into fastscroll_fix
using pulled version of fix to remove_all bug (with an improvement)
This commit is contained in:
commit
681b8998c2
1 changed files with 7 additions and 5 deletions
10
dwmblocks.c
10
dwmblocks.c
|
@ -53,11 +53,13 @@ void replace(char *str, char old, char new)
|
|||
void remove_all(char *str, char to_remove) {
|
||||
char *read = str;
|
||||
char *write = str;
|
||||
do {
|
||||
while (*read == to_remove) read++;
|
||||
while (*read) {
|
||||
if (*read != to_remove) {
|
||||
*write++ = *read;
|
||||
read++;
|
||||
} while (*(read-1));
|
||||
}
|
||||
++read;
|
||||
}
|
||||
*write = '\0';
|
||||
}
|
||||
|
||||
int gcd(int a, int b)
|
||||
|
|
Loading…
Reference in a new issue