mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-03 13:20:26 +02:00
(scm_getc, scm_lfwrite): Recognise \a \b and \r for port column.
This commit is contained in:
parent
1e7e862431
commit
f86d524a89
1 changed files with 27 additions and 11 deletions
|
@ -955,17 +955,25 @@ scm_getc (SCM port)
|
||||||
|
|
||||||
c = *(pt->read_pos++);
|
c = *(pt->read_pos++);
|
||||||
|
|
||||||
if (c == '\n')
|
switch (c)
|
||||||
{
|
{
|
||||||
SCM_INCLINE (port);
|
case '\a':
|
||||||
}
|
break;
|
||||||
else if (c == '\t')
|
case '\b':
|
||||||
{
|
SCM_DECCOL (port);
|
||||||
SCM_TABCOL (port);
|
break;
|
||||||
}
|
case '\n':
|
||||||
else
|
SCM_INCLINE (port);
|
||||||
{
|
break;
|
||||||
SCM_INCCOL (port);
|
case '\r':
|
||||||
|
SCM_ZEROCOL (port);
|
||||||
|
break;
|
||||||
|
case '\t':
|
||||||
|
SCM_TABCOL (port);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SCM_INCCOL (port);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
|
@ -1000,9 +1008,17 @@ scm_lfwrite (const char *ptr, size_t size, SCM port)
|
||||||
ptob->write (port, ptr, size);
|
ptob->write (port, ptr, size);
|
||||||
|
|
||||||
for (; size; ptr++, size--) {
|
for (; size; ptr++, size--) {
|
||||||
if (*ptr == '\n') {
|
if (*ptr == '\a') {
|
||||||
|
}
|
||||||
|
else if (*ptr == '\b') {
|
||||||
|
SCM_DECCOL(port);
|
||||||
|
}
|
||||||
|
else if (*ptr == '\n') {
|
||||||
SCM_INCLINE(port);
|
SCM_INCLINE(port);
|
||||||
}
|
}
|
||||||
|
else if (*ptr == '\r') {
|
||||||
|
SCM_ZEROCOL(port);
|
||||||
|
}
|
||||||
else if (*ptr == '\t') {
|
else if (*ptr == '\t') {
|
||||||
SCM_TABCOL(port);
|
SCM_TABCOL(port);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue