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
12
dwmblocks.c
12
dwmblocks.c
|
@ -53,11 +53,13 @@ void replace(char *str, char old, char new)
|
||||||
void remove_all(char *str, char to_remove) {
|
void remove_all(char *str, char to_remove) {
|
||||||
char *read = str;
|
char *read = str;
|
||||||
char *write = str;
|
char *write = str;
|
||||||
do {
|
while (*read) {
|
||||||
while (*read == to_remove) read++;
|
if (*read != to_remove) {
|
||||||
*write++ = *read;
|
*write++ = *read;
|
||||||
read++;
|
}
|
||||||
} while (*(read-1));
|
++read;
|
||||||
|
}
|
||||||
|
*write = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
int gcd(int a, int b)
|
int gcd(int a, int b)
|
||||||
|
|
Loading…
Reference in a new issue