mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* util.c: Added the function str_replace, which replaces all occurences of a character in a string.
This commit is contained in:
parent
b328811d2a
commit
c6e3dde5a5
@ -1,3 +1,7 @@
|
||||
2004-18-19 Roland Illig <roland.illig@gmx.de>
|
||||
* util.c: Added the function str_replace, which replaces
|
||||
all occurences of a character in a string.
|
||||
|
||||
2004-08-19 Pavel Shirshov <pavelsh@mail.ru>
|
||||
|
||||
* utilunix.c (mc_tmpdir): Fix typos in comment.
|
||||
|
@ -47,6 +47,14 @@
|
||||
static const char app_text [] = "Midnight-Commander";
|
||||
int easy_patterns = 1;
|
||||
|
||||
extern void str_replace(char *s, char from, char to)
|
||||
{
|
||||
for (; *s != '\0'; s++) {
|
||||
if (*s == from)
|
||||
*s = to;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
is_7bit_printable (unsigned char c)
|
||||
{
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
/* String managing functions */
|
||||
|
||||
void str_replace(char *s, char from, char to);
|
||||
int is_printable (int c);
|
||||
int msglen (const char *text, int *lines);
|
||||
char *trim (char *s, char *d, int len);
|
||||
|
Loading…
Reference in New Issue
Block a user