* 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
[] = "@(#)filename.c 5.7 (Berkeley) %G%";
* A central function for any command that has to deal with a filename
* (to be or not to be remembered).
int l_esc
= 0, l_bang_flag
= 0;
l_fname
= calloc(FILENAME_LEN
+2, sizeof(char));
strcpy(help_msg
, "out of memory error");
if ((ss
= getc(inputt
)) != ' ') {
* It's not really an error, but to flag remembered
* filename is to be used.
"space required before filename given");
while (ss
= getc(inputt
))
if ((ss
== '\\') && (l_esc
== 0)) {
if ((ss
== '\n') || (ss
== EOF
)) {
if ((ss
== '!') && (l_esc
== 0) && (l_cnt
< 2))
if ((ss
!= ' ') || (l_bang_flag
))
if (l_cnt
>= FILENAME_LEN
) {
strcpy(help_msg
, "filename+path length too long");
if (l_fname
[0] == '\0') {
strcpy(l_fname
, filename_current
);
if (sigint_flag
&& (!sigspecial
))
l_fname
[FILENAME_LEN
+1] = l_bang_flag
;