X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fmatchstr.c;h=686991867b7475a2e1bde16a46cd95d7b4db1f5a;hp=82aa0062fee6e45409cd21b92ab1fc8f4247dc44;hb=5a0398df33ef2f0ed66ef4703c13b3edae754bae;hpb=afb059d3e508ad4fd38f4a9fd643a4bedf3e0b3f diff --git a/src/matchstr.c b/src/matchstr.c index 82aa006..6869918 100644 --- a/src/matchstr.c +++ b/src/matchstr.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ @@ -92,6 +92,20 @@ int yaz_memcmp(const void *a, const void *b, size_t len_a, size_t len_b) return len_a - len_b; } +int yaz_strcmp_null(const char *v1, const char *v2) +{ + if (v1) + { + if (v2) + return strcmp(v1, v2); + else + return 1; + } + else if (v2) + return -1; + return 0; +} + /* * Local variables: * c-basic-offset: 4