summaryrefslogtreecommitdiffstats
path: root/tpu.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-07-25 05:20:54 +0200
committerLouis Burda <quent.burda@gmail.com>2023-07-25 05:20:54 +0200
commit41760436d528552d64122bb0c837f4d8274a0bdd (patch)
treee8acbd7bb0663f1c76bb6a490c37c7e6338613ba /tpu.c
parentf621bed8f9bf20eca167d7cfa40840992c26da09 (diff)
downloadtis100-41760436d528552d64122bb0c837f4d8274a0bdd.tar.gz
tis100-41760436d528552d64122bb0c837f4d8274a0bdd.zip
Fix label_map case insensitivity and allow numbers in label names
Diffstat (limited to 'tpu.c')
-rw-r--r--tpu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tpu.c b/tpu.c
index ee5a173..be55e05 100644
--- a/tpu.c
+++ b/tpu.c
@@ -89,7 +89,7 @@ label_map_link_pos(struct label_map *map, const char *name)
struct label_map_link **link;
link = &map->buckets[djb_hash(name) % LABEL_MAP_BUCKETS];
- while (*link && strcmp((*link)->label, name))
+ while (*link && strcasecmp((*link)->label, name))
link = &(*link)->next;
return link;
@@ -99,7 +99,6 @@ bool
label_map_add(struct label_map *map, const char *name, size_t pc)
{
struct label_map_link **pos, *link;
- char *c;
pos = label_map_link_pos(map, name);
if (*pos) return false;
@@ -110,8 +109,6 @@ label_map_add(struct label_map *map, const char *name, size_t pc)
if (!link) die("malloc:");
link->label = strdup(name);
if (!link->label) die("strdup:");
- for (c = link->label; *c; c++)
- *c = (char) tolower(*c);
link->pc = pc;
link->next = NULL;