diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-12 21:01:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-12 21:01:04 +0100 |
commit | bf5110266ca950b7ccdd07817f61020204e1caae (patch) | |
tree | 08dfec88cb61bed3a4bf0ae2b36d7910de3801cf /src/nvim/memory.c | |
parent | c8f0f8fea6e3170db0d68d61dd84f3c3ef9ee77c (diff) | |
parent | c5e61b41a53c4fac93f1101ece1a23168eccb3a3 (diff) | |
download | rneovim-bf5110266ca950b7ccdd07817f61020204e1caae.tar.gz rneovim-bf5110266ca950b7ccdd07817f61020204e1caae.tar.bz2 rneovim-bf5110266ca950b7ccdd07817f61020204e1caae.zip |
Merge #6262 from justinmk/dirchanged
DirChanged fixes
Diffstat (limited to 'src/nvim/memory.c')
-rw-r--r-- | src/nvim/memory.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/memory.c b/src/nvim/memory.c index b593936d7b..58c01fbe7a 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -475,6 +475,13 @@ void *xmemdup(const void *data, size_t len) return memcpy(xmalloc(len), data, len); } +/// Returns true if strings `a` and `b` are equal. Arguments may be NULL. +bool strequal(const char *a, const char *b) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT +{ + return (a == NULL && b == NULL) || (a && b && strcmp(a, b) == 0); +} + /* * Avoid repeating the error message many times (they take 1 second each). * Did_outofmem_msg is reset when a character is read. |