diff --git a/lib/master.pike b/lib/master.pike index a68d23a60049fbe0664c5cd0ad4955793282f0da..7fee0c515b08ea8a8c88611cbedeafee571ab8ce 100644 --- a/lib/master.pike +++ b/lib/master.pike @@ -517,8 +517,26 @@ string handle_include(string f, // FIXME string stupid_describe(mixed m) { - if(intp(m)) return (string)m; - return sprintf("%t",m); + switch(string typ=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,