From 1549b55130fcb7ae964ee1e2f9b1cc5199194c4a Mon Sep 17 00:00:00 2001
From: Recolic Keghart <root@recolic.net>
Date: Wed, 26 Feb 2020 04:21:46 -0800
Subject: [PATCH] bug fix

---
 utils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils.py b/utils.py
index e9a9ffc..dc6dbf9 100644
--- a/utils.py
+++ b/utils.py
@@ -40,9 +40,10 @@ def npmat_truncate_cols(mat, max_cols):
 def get_id_prefix_from_string(s):
     first_illegal_char_index = 0
     for i, c in enumerate(s.replace(' ', '')):
-        first_illegal_char_index = i
         if c not in 'QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm.-':
             break
+        else:
+            first_illegal_char_index = i + 1
     return s[:first_illegal_char_index]
 
 def stoi(s):
-- 
GitLab