So we keep putting our trust in things that rust
And then we feel the pain of loss
(James, "Stripmining")

# Known Bugs, Problems And Limitations

Every program sucks. Read why this program sucks, too.

## Known Bugs

Below you can find a list of currently known bugs. Feel free to fix them yourself.

- Sometimes the file position for messages does not make sense. One of those bugs when you fix it in one place, it shows up in another.
- Skipping macros with complex `<$if>` conditions occasionally leads to an ```unexpted end of context`''. This can probably be solved by improving `skip_expression()` in hsclib/skip.c.

## Internal Error Messages

This is a special kind of messages which does not fit into the schema of all those messages described at another chapter. When processing it's input, `hsc` does not only check whether the user made a mistake, but also the authors of these tools. In several places of the source code, `hsc` tests for things that must not happen. If they do, `hsc` assumes it has completely fucked up. In this case, it simply displays a message on the screen and aborts.

An example message could look like this:

    ** internal error at "hugo.c" (123): sepp is not at home

These messages are not really meant to be interpreted by the user, but by the programmer. When `hsc` prints an internal error message, you should contact the author and report this bug, including the complete text of the panic message and possibly the source you were processing when it happened. In such a case, you are not expected to create a sophisticated bug report, as such problems are hard to trace.

## Known Problems

The problems described below probably won't ever be fixed.

- URI checking is performed via trying to open a file. As AmigaOS is case-insensitive dealing with filenames, problems might occur when copying the HTML object-tree to a case-sensitive file system. I recommend to rebuild the whole project at the target system.
- If you specify a `<BASE HREF="..">`, `hsc` is unable to find out how the base is related to the destination directory and will treat all local URIs like external ones. Therefore, no link validation will be performed. Project relative URIs are not possible with a base-URI set, of course.
- The obsolete tags `<LISTING>` and `<XMP>` might not be treated correctly, as the behavior of these two seems so be not very strictly defined. You should avoid them anyway and use `<PRE>` or `<$source>` instead.
- With commandline option `STRIPBADWS` enabled, source code like ```<b>hello <!-- xy --></b>`'' is not converted to ```<b>hello<!-- xy --></b>`''. That means that the blank after ```hello`'' will remain, but does not display a message #79, as the `<!..>` caused all preceding whitespace to be flushed. I already said it several times, and I'll say it again: Do not use those bloody SGML comments!
- `Hsc` doesn't care much about the maximum length of filenames. If a filename gets too long, it depends on `fopen()` of your compiler whether an error is reported or the filename is truncated. If you insist on filenames containing 46587643 characters, `hsc` can cope with it - but your OS probably won't.
- You should try to avoid using a project file and pipes together; although `hsc` should now be able to cope with this without enforcer hits (AKA segfaults outside the AmigaOS world), it might still behave unreasonably and end up with funny project files and dependencies.
- Out-of-memory conditions can cause small memory leaks on AmigaOS. This is because `hsc` uses a special `malloc()`-function which just displays an error message and quits using `exit()`. As `hsc` keeps track of all allocated resources, it will release everything that could be fully initialised and made it into its supposed resource list. For out-of-memories during partially initializing complex structures, this fails and can cause memory leaks (normally approx. 100-500 bytes). Usually, these are handled by your OS or, as for AmigaOS, by the `malloc()`-function of the runtime library, so you shouldn't bother too much about that. Blame K&R (or whoever perpetrated `malloc()`)for their brain-damaged memory management concepts.
- `GetFileSize()` probably won't work correctly on files greater than 2 GB. This usually caused by the limited abilities of `fseek()` and `ftell()`.

## Limitations

`Hsc` is fully dynamic and its input size, number of syntax-elements and etc. is only limited by memory and disk space. Only some less important status messages are created in classic, braindead zero-terminated C character arrays and are truncated if they become too long.

However, for projects much larger than 100 documents (on a 68060 or equivalent), scanning the project file on every run takes an awful lot of time; due the lack of any portable concept of keeping data resident after a program exits, there is no workaround for this (same problem like with hsc.prefs); you will have to get rid of the project-file and `hscdepp` for such projects.