From d9fcbc2cfb5f20f63a2870624ce48a58cf918ea8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 12 Mar 2017 12:11:10 +0100 Subject: DirChanged: trigger when switching scopes Closes #6054 --- src/nvim/memory.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/memory.c') 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. -- cgit