date and time created 93/01/23 11:13:07 by bostic
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 24 Jan 1993 03:13:07 +0000 (19:13 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 24 Jan 1993 03:13:07 +0000 (19:13 -0800)
SCCS-vsn: contrib/ed/f.c 5.1

usr/src/contrib/ed/f.c [new file with mode: 0644]

diff --git a/usr/src/contrib/ed/f.c b/usr/src/contrib/ed/f.c
new file mode 100644 (file)
index 0000000..9c24bc7
--- /dev/null
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Rodney Ruddock of the University of Guelph.
+ *
+ * %sccs.include.redist.c%
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)f.c        5.1 (Berkeley) %G%";
+#endif /* not lint */
+
+#include "ed.h" 
+
+/*
+ * Prints out or sets the remembered filename.
+ */
+
+void
+f(inputt, errnum)
+
+FILE *inputt;
+int *errnum;
+
+{
+  char *l_temp;
+
+  l_temp = filename(inputt, errnum);
+  if (sigint_flag)
+     SIGINT_ACTION;
+  if (*errnum == 1)
+    {
+      free(filename_current);
+      filename_current = l_temp;
+    }
+  else if (*errnum == -2)
+    while (((ss = getc(inputt)) != '\n') || (ss == EOF))
+         ;
+  else if (*errnum < 0)
+      return;
+  if (sigint_flag)
+     SIGINT_ACTION;
+  fwrite(filename_current, sizeof(char), strlen(filename_current), stdout);
+  putchar('\n');
+  *errnum = 1;
+} /* end-f */