commit 198d1ebbb704dd80f0740ab3859a7fc5fa54769a
parent d28e04853298face6e9a03a8c2b76bffcb394b32
Author: sin <sin@2f30.org>
Date: Sun, 7 Apr 2019 13:27:49 +0100
Case-insensitive matching
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/compress.c b/compress.c
@@ -3,6 +3,7 @@
#include <err.h>
#include <stdint.h>
#include <string.h>
+#include <strings.h>
#include <lz4.h>
@@ -164,7 +165,7 @@ compr_name2type(char *name)
struct algomap *algo;
for (algo = &algomap[0]; algo->name != NULL; algo++)
- if (strcmp(algo->name, name) == 0)
+ if (strcasecmp(algo->name, name) == 0)
break;
if (algo->name == NULL)
return -1;
diff --git a/hash.c b/hash.c
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include "blake2.h"
#include "dedup.h"
@@ -111,7 +112,7 @@ hash_name2type(char *name)
struct algomap *algo;
for (algo = &algomap[0]; algo->name != NULL; algo++)
- if (strcmp(algo->name, name) == 0)
+ if (strcasecmp(algo->name, name) == 0)
break;
if (algo->name == NULL)
return -1;