fixing ambiguity in reading hex numbers and floating point
making print robust against the undefined value
This commit is contained in:
		
							parent
							
								
									115b2843fb
								
							
						
					
					
						commit
						7883a5de0b
					
				| 
						 | 
					@ -375,6 +375,7 @@ void fl_print_child(ios_t *f, value_t v, int princ)
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case TAG_CVALUE:
 | 
					    case TAG_CVALUE:
 | 
				
			||||||
    case TAG_CPRIM:
 | 
					    case TAG_CPRIM:
 | 
				
			||||||
 | 
					      if (v == UNBOUND) { HPOS+=ios_printf(f, "#<undefined>"); break; }
 | 
				
			||||||
    case TAG_VECTOR:
 | 
					    case TAG_VECTOR:
 | 
				
			||||||
    case TAG_CONS:
 | 
					    case TAG_CONS:
 | 
				
			||||||
        if ((label=(value_t)ptrhash_get(&printconses, (void*)v)) !=
 | 
					        if ((label=(value_t)ptrhash_get(&printconses, (void*)v)) !=
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,8 @@ static int isnumtok_base(char *tok, value_t *pval, int base)
 | 
				
			||||||
    double d;
 | 
					    double d;
 | 
				
			||||||
    if (*tok == '\0')
 | 
					    if (*tok == '\0')
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
    if (strpbrk(tok, ".eEpP")) {
 | 
					    if (!((tok[0]=='0' && tok[1]=='x') || (base >= 15)) &&
 | 
				
			||||||
 | 
					        strpbrk(tok, ".eEpP")) {
 | 
				
			||||||
        d = strtod(tok, &end);
 | 
					        d = strtod(tok, &end);
 | 
				
			||||||
        if (*end == '\0') {
 | 
					        if (*end == '\0') {
 | 
				
			||||||
            if (pval) *pval = mk_double(d);
 | 
					            if (pval) *pval = mk_double(d);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue