Hi!

     Just tested. This was hard (unlike MS-DOS, which wrongly expands tabs
when output to redirected stdout mixed with output to stderr, under FreeDOS
tabs was expanded correctly), but I build example when tabs expansion is
broken under FreeDOS also:

______________O\_/_________________________________\_/O______________
#include <io.h>
#include <dos.h>
void putstr (const char *s) {
        while (*s) {
                union REGS r;
                r.h.dl = *s++; r.h.ah = 2; intdos (&r, &r);
}       }
#define STDERR 2
int main () {
        write  (STDERR, "\t1", 2);
        putstr (        "\t2");
        write  (STDERR, "\t34", 3);
        putstr (        "\t56");
        return 0;
}
_____________________________________________________________________
              O/~\                                 /~\O

If run this code as "test>file", then both under MS-DOS and FreeDOS `file'
contains 16 bytes, instead 19 bytes (two expanded tabs, "2" and "56").

     Also, I not tested this (no printer), but looks like echoing to printer
is not very correct. I mean, to printer echoed not only ouput to screen
(device with SFT_FCONOUT), but to any other devices (for example, COMn),
except NUL. This is because cooked_write_char() doesn't checks which device
it uses to output ("is it SFT_FCONOUT?") before echoing.

     On the other side, stream to NUL doesn't echoed because DosRWSft
doesn't calls cooked_write() if there is SFT_FNUL.

     I don't know what is wrong (echoing stream from non-screen devices or
not-echoing stream to NUL) and don't know how to change first event (echoing
NUL-stream is easy: simply remove check for SF_FNUL before calling
cooked_write()).




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to