aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-09-21 11:05:13 +0000
committerrodri <rgl@antares-labs.eu>2024-09-21 11:05:13 +0000
commitb67c52fb5d8ea4ec8ac9ca8490619898feaaf3f0 (patch)
treeaf1b29bafecd295d6c83f0e89f3d061c521d4554
parent6be6c7a12a4dc890ca67750aa8924f430b2922ea (diff)
downloadlibobj-b67c52fb5d8ea4ec8ac9ca8490619898feaaf3f0.tar.gz
libobj-b67c52fb5d8ea4ec8ac9ca8490619898feaaf3f0.tar.bz2
libobj-b67c52fb5d8ea4ec8ac9ca8490619898feaaf3f0.zip
allow '-' in object and material names.
-rw-r--r--obj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/obj.c b/obj.c
index 8640776..345d5fb 100644
--- a/obj.c
+++ b/obj.c
@@ -629,7 +629,7 @@ objparse(char *file)
}
do{
*p++ = c;
- }while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_') && p-buf < sizeof(buf)-1);
+ }while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_' || c == '-') && p-buf < sizeof(buf)-1);
*p = 0;
o = geto(obj, buf);
if(o == nil){
@@ -850,7 +850,7 @@ Line2:
p = buf;
do{
*p++ = c;
- }while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_') && p-buf < sizeof(buf)-1);
+ }while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_' || c == '-') && p-buf < sizeof(buf)-1);
*p = 0;
if((obj->materials = objmtlparse(buf)) == nil){
error("objmtlparse: %r");
@@ -862,7 +862,7 @@ Line2:
p = buf;
do{
*p++ = c;
- }while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_') && p-buf < sizeof(buf)-1);
+ }while(c = Bgetc(bin), (isalnum(c) || c == '.' || c == '_' || c == '-') && p-buf < sizeof(buf)-1);
*p = 0;
if(obj->materials != nil && (m = getmtl(obj->materials, buf)) == nil){
error("no material '%s' found", buf);