aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.c
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-19 12:26:08 -0600
committerJosh Rahm <rahm@google.com>2022-08-19 13:06:41 -0600
commita7237662f96933efe29eed8212464571e3778cd0 (patch)
tree27930202726b4251437c8cfa53069f65b4db90dc /src/nvim/strings.c
parent02292344929069ea63c0bb872cc22d552d86b67f (diff)
parentb2f979b30beac67906b2dd717fcb6a34f46f5e54 (diff)
downloadrneovim-a7237662f96933efe29eed8212464571e3778cd0.tar.gz
rneovim-a7237662f96933efe29eed8212464571e3778cd0.tar.bz2
rneovim-a7237662f96933efe29eed8212464571e3778cd0.zip
Merge branch 'master' of https://github.com/neovim/neovim into rahmtmp
Diffstat (limited to 'src/nvim/strings.c')
-rw-r--r--src/nvim/strings.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c
index 22effaade0..78312c738c 100644
--- a/src/nvim/strings.c
+++ b/src/nvim/strings.c
@@ -191,7 +191,7 @@ char *vim_strnsave_unquoted(const char *const string, const size_t length)
char_u *vim_strsave_shellescape(const char_u *string, bool do_special, bool do_newline)
FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ALL
{
- char_u *d;
+ char *d;
char_u *escaped_string;
size_t l;
int csh_like;
@@ -238,7 +238,7 @@ char_u *vim_strsave_shellescape(const char_u *string, bool do_special, bool do_n
// Allocate memory for the result and fill it.
escaped_string = xmalloc(length);
- d = escaped_string;
+ d = (char *)escaped_string;
// add opening quote
#ifdef WIN32
@@ -248,7 +248,7 @@ char_u *vim_strsave_shellescape(const char_u *string, bool do_special, bool do_n
#endif
*d++ = '\'';
- for (const char_u *p = string; *p != NUL;) {
+ for (const char *p = (char *)string; *p != NUL;) {
#ifdef WIN32
if (!p_ssl) {
if (*p == '"') {
@@ -264,7 +264,7 @@ char_u *vim_strsave_shellescape(const char_u *string, bool do_special, bool do_n
*d++ = '\\';
*d++ = '\'';
*d++ = '\'';
- ++p;
+ p++;
continue;
}
if ((*p == '\n' && (csh_like || do_newline))
@@ -276,7 +276,7 @@ char_u *vim_strsave_shellescape(const char_u *string, bool do_special, bool do_n
*d++ = *p++;
continue;
}
- if (do_special && find_cmdline_var(p, &l) >= 0) {
+ if (do_special && find_cmdline_var((char_u *)p, &l) >= 0) {
*d++ = '\\'; // insert backslash
while (--l != SIZE_MAX) { // copy the var
*d++ = *p++;
@@ -431,8 +431,8 @@ int vim_stricmp(const char *s1, const char *s2)
if (*s1 == NUL) {
break; // strings match until NUL
}
- ++s1;
- ++s2;
+ s1++;
+ s2++;
}
return 0; // strings match
}
@@ -457,9 +457,9 @@ int vim_strnicmp(const char *s1, const char *s2, size_t len)
if (*s1 == NUL) {
break; // strings match until NUL
}
- ++s1;
- ++s2;
- --len;
+ s1++;
+ s2++;
+ len--;
}
return 0; // strings match
}