Christian Sievers <[EMAIL PROTECTED]> writes:
> I noticed two things which I think might be called bugs, at least I am
> near doing so:
>
> The first thing really annoys me:
> If you input something like
>
> [0,x] where x=x
>
> you get no output at all before you interupt.
> I think the output is buffered, and I don't like it.
You're right - that is annoying.
A simple fix is to change the value of "FLUSH_EVERY" in prelude.h
and recompile:
99c99
< #define FLUSHEVERY (DJGPP2)
---
> #define FLUSHEVERY 1
This affects the behaviour of primPutStr and primHPutStr.
I'm putting this fix into the next release - people should shout if
they think this is a bad idea.
> The other thing is less import and more like a bug, after all it lets
> you crash hugs quite easily. (I really guess you know it.) Just type
>
> :s -p"%s%s%s"
>
> [snip]
>
> The reason is obviously the way the prompt is enabled to tell the
> last loaded module (a feature I don't like as a default anyway), so
> some checking of the string given to the p-option should be done.
The problem occurs because the prompt string is processed using
sprintf instead of writing our own piece of code to perform the
substitution (as is done when processing other strings such as the
value of the "-E" option). In this case, the second and third
occurrences of %s refer to arguments that are not supplied to the call
to sprintf. The determined hacker could probably crash Hugs by using
other sprintf format strings instead of %s or by attempting to
generate a string that exceeds 1000 characters.
I don't think this bug is actually causing problems for people so I'm
treating this as a low-priority for now. If anyone feels like writing
a new version of the "promptForInput" function which performs all
appropriate checks, I'll happily use that instead.
--
Alastair Reid Yale Haskell Project Hacker
[EMAIL PROTECTED] http://WWW.CS.Yale.EDU/homes/reid-alastair/