-static char *sccsid = "@(#)touch.c 1.6 (Berkeley) %G%";
-#include <stdio.h>
-#include <ctype.h>
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)touch.c 5.5 (Berkeley) %G%";
+#endif /* not lint */
+
#include <sys/types.h>
#include <sys/stat.h>
-#include <signal.h>
+#include <sys/signal.h>
+#include <stdio.h>
+#include <ctype.h>
#include "error.h"
+#include "pathnames.h"
/*
* Iterate through errors
boolean previewed;
int errordest; /* where errors go*/
- previewed = preview(name, nerrors, files, ix);
-
- errordest = settotouch(name);
+ if (!oktotouch(name)) {
+ previewed = FALSE;
+ errordest = TOSTDOUT;
+ } else {
+ previewed = preview(name, nerrors, files, ix);
+ errordest = settotouch(name);
+ }
if (errordest != TOSTDOUT)
touchedfiles[ix] = TRUE;
int back;
reg Eptr *erpp;
- if (!oktotouch(name))
- return(false);
if (nerrors <= 0)
- return(false);
- back = false;
+ return(FALSE);
+ back = FALSE;
if(query){
switch(inquire(terse
? "Preview? "
: "Do you want to preview the errors first? ")){
case Q_YES:
case Q_yes:
- back = true;
+ back = TRUE;
EITERATE(erpp, files, ix){
errorprint(stdout, *erpp, TRUE);
}
FILE *n_touchedfile; /* the new file */
char *o_name;
char n_name[64];
-char *canon_name = "/tmp/ErrorXXXXXX";
+char *canon_name = _PATH_TMP;
int o_lineno;
int n_lineno;
boolean tempfileopen = FALSE;
fclose(tmpfile);
}
if (oktorm == 0){
- fprintf(stderr, "%s: Catastrophe: A copy of \"%s\: was saved in \"%s\"\n",
+ fprintf(stderr, "%s: Catastrophe: A copy of \"%s\": was saved in \"%s\"\n",
processname, o_name, n_name);
exit(1);
}