Skip to content
Snippets Groups Projects
Commit 6283b620 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

better error messages

Rev: lib/master.pike:1.32
parent a0de788f
No related branches found
No related tags found
No related merge requests found
...@@ -517,8 +517,26 @@ string handle_include(string f, ...@@ -517,8 +517,26 @@ string handle_include(string f,
// FIXME // FIXME
string stupid_describe(mixed m) string stupid_describe(mixed m)
{ {
if(intp(m)) return (string)m; switch(string typ=sprintf("%t",m))
return sprintf("%t",m); {
case "int":
case "float":
return (string)m;
case "string":
if(sizeof(m) < 60 && sscanf(m,"%*[-a-zAZ0-9.~`!@#$%^&*()_]%n",int i) && i==sizeof(m))
{
return "\""+m+"\"";
}
case "array":
case "mapping":
case "multiset":
return typ+"["+sizeof(m)+"]";
default:
return sprintf("%t",m);
}
} }
/* It is possible that this should be a real efun, /* It is possible that this should be a real efun,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment