From 6283b620bb70edac6540e79a96430f8123498b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Thu, 27 Feb 1997 04:19:31 -0800 Subject: [PATCH] better error messages Rev: lib/master.pike:1.32 --- lib/master.pike | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/master.pike b/lib/master.pike index a68d23a600..7fee0c515b 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, -- GitLab