36cee0152216c77a1d6954b50e28bbcecf62483d
* Copyright (c) 1992 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Rodney Ruddock of the University of Guelph.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)l.c 5.3 (Berkeley) %G%";
* This is the list command. It's not wrapped in with n and p because
* of the unambiguous printing needed.
if (start_default
&& End_default
)
strcpy(help_msg
, "empty buffer");
start_default
= End_default
= 0;
if (rol(inputt
, errnum
)) /* For "command-suffix pairs". */
* Print out the line character-by-character and split the
* line when line length is at line_length.
get_line(current
->handle
, current
->len
);
if (sigint_flag
&& (!sigspecial
))
for (l_cnt
= 0; l_cnt
< current
->len
; l_cnt
++, l_len
+= 2) {
/* Check if line needs to be broken first. */
if ((l_len
) % line_length
== 0)
else switch (text
[l_cnt
]) {
case '\b': /* backspace (cntl-H) */
fwrite("\\b", sizeof(char), 2, stdout
);
case '\t': /* horizontal tab */
fwrite("\\t", sizeof(char), 2, stdout
);
case '\n': /* newline (not that there is one). */
fwrite("\\n", sizeof(char), 2, stdout
);
case '\v': /* vertical tab */
fwrite("\\v", sizeof(char), 2, stdout
);
case '\f': /* form feed */
fwrite("\\f", sizeof(char), 2, stdout
);
fwrite("\\r", sizeof(char), 2, stdout
);
if ((text
[l_cnt
] < 32) ||
putchar(text
[l_cnt
] / 64 + '0');
putchar(text
[l_cnt
] / 8 + '0');
putchar(text
[l_cnt
] % 8 + '0');
} else if (text
[l_cnt
] == '\\')
fwrite("\\\\", sizeof(char), 2, stdout
);
current
= current
->below
;