lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev [PATCH 2.8.4rel.1] Unlink TMP files


From: Ilya Zakharevich
Subject: lynx-dev [PATCH 2.8.4rel.1] Unlink TMP files
Date: Wed, 18 Jul 2001 16:57:32 -0400
User-agent: Mutt/1.2.5i

This makes lynx independent of system programs when unlinking files.

[I did not touch the VMS branch since I do not know the semantic of
the POSIX subsystem.]  One new gettext message may need to be added.

Enjoy,
Ilya

P.S.  There is one goof I found when making -Zomf executable on OS/2:
      src/makefile mentions two .o files (instead of $(_O) files).

      Another goof: I see that sendmail does not have its directory
      part stripped even with --disable-full-paths.

--- ./src/HTFWriter.c-pre       Sun Jun  3 11:58:00 2001
+++ ./src/HTFWriter.c   Wed Jul 18 13:43:40 2001
@@ -441,6 +441,12 @@ PRIVATE void HTFWriter_free ARGS1(HTStre
     return;
 }
 
+#ifdef VMS
+#  define REMOVE_COMMAND "delete/noconfirm/nolog %s;"
+#else
+#  define REMOVE_COMMAND "%s"
+#endif /* VMS */
+
 /*     Abort writing
 **     -------------
 */
@@ -455,7 +461,19 @@ PRIVATE void HTFWriter_abort ARGS2(
        CTRACE((tfp, "HTFWriter: Aborting: file not executed or saved.\n"));
        FREE(me->end_command);
        if (me->remove_command) {
+#ifdef VMS
            LYSystem(me->remove_command);
+#else
+           chmod(me->remove_command, 0600);            /* Ignore errors */
+           if (0 != unlink(me->remove_command)) {
+               char buf[560];
+
+               sprintf(buf, "%.60s '%.400s': %.60s",
+                       gettext("Error deleting file"),
+                       me->remove_command, strerror(errno));
+               HTAlert(buf);
+           }
+#endif
            FREE(me->remove_command);
        }
     }
@@ -588,12 +606,6 @@ PRIVATE char *mailcap_substitute ARGS3(
 #endif
     return result;
 }
-
-#ifndef VMS
-#define REMOVE_COMMAND "/bin/rm -f %s"
-#else
-#define REMOVE_COMMAND "delete/noconfirm/nolog %s;"
-#endif /* VMS */
 
 /*     Take action using a system command
 **     ----------------------------------

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]