2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 ANSI C function gets().
9 #include <dos/dosextens.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
18 /*****************************************************************************
29 Read one line of characters from the standard input stream into
30 the buffer. Reading will stop, when a newline ('\n') is encountered,
31 EOF or when the buffer is full. If a newline is read, then it is
32 replaced by '\0'. The last character in the buffer is always '\0'.
35 buffer - Write characters into this buffer
38 buffer or NULL in case of an error or EOF.
45 Never use this function. gets() does not know how large the buffer
46 is and will continue to store characters past the end of the buffer
47 if it has not encountered a newline or EOF yet. Use fgets() instead.
54 ******************************************************************************/
56 char *s
= fgets(buffer
, BUFSIZ
, stdin
);
59 /* strip trailing \n */
60 size_t sl
= strlen(s
);
61 if ( (sl
> 0) && (s
[sl
-1] == '\n') )