]> code.citadel.org Git - citadel.git/commitdiff
* When calling an external editor, set the environment variable
authorArt Cancro <ajc@citadel.org>
Tue, 27 Nov 2001 17:08:29 +0000 (17:08 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 27 Nov 2001 17:08:29 +0000 (17:08 +0000)
  WINDOW_TITLE to an appropriate value.

citadel/ChangeLog
citadel/messages.c
citadel/rooms.c
citadel/routines2.c

index 82ae6cb8ffc2104be9cdb4a719b73e4909162a7f..e856cd9b2253bafe542355b5ccd1f482cd415c0f 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 580.79  2001/11/27 17:08:29  ajc
+ * When calling an external editor, set the environment variable
+   WINDOW_TITLE to an appropriate value.
+
  Revision 580.78  2001/11/26 03:27:08  ajc
  * new algorithm to load the use table
 
@@ -2874,4 +2878,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index f79e6d27e9964837d063aa396132f4b1e0f79e9f..8bd1700519b73c45b28dc69e6dc379c44e6d2e29 100644 (file)
@@ -608,7 +608,8 @@ int make_message(char *filename,    /* temporary file name */
        FILE *fp;
        int a, b, e_ex_code;
        long beg;
-       char datestr[64];
+       char datestr[SIZ];
+       char header[SIZ];
        int cksum = 0;
 
        if (mode == 2)
@@ -619,17 +620,20 @@ int make_message(char *filename,  /* temporary file name */
                }
 
        fmt_date(datestr, time(NULL));
+       header[0] = 0;
 
        if (room_flags & QR_ANONONLY) {
-               printf(" ****");
+               sprintf(&header[strlen(header)], " ****");
        }
        else {
-               printf(" %s from %s", datestr, fullname);
+               sprintf(&header[strlen(header)],
+                       " %s from %s", datestr, fullname);
                if (strlen(recipient) > 0) {
-                       printf(" to %s", recipient);
+                       sprintf(&header[strlen(header)],
+                               " to %s", recipient);
                }
        }
-       printf("\n");
+       printf("%s\n", header);
 
        beg = 0L;
 
@@ -700,6 +704,7 @@ ME1:        switch (mode) {
                if (editor_pid == 0) {
                        chmod(filename, 0600);
                        sttybbs(SB_RESTORE);
+                       setenv("WINDOW_TITLE", header, 1);
                        execlp(editor_path, editor_path, filename, NULL);
                        exit(1);
                }
index 0cf641886f0a8c2b5e8fa07acd42cca4546ef65a..5fc56c3c636e7d5fac2d32b2c378998ad1dda856 100644 (file)
@@ -1054,6 +1054,7 @@ void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd)
        cksum = file_checksum(temp);
 
        if (strlen(editor_path) > 0) {
+               setenv("WINDOW_TITLE", desc, 1);
                editor_pid = fork();
                if (editor_pid == 0) {
                        chmod(temp, 0600);
index 8257176d9699d60aed9e35187dea17065fbea0bb..d4402081471f3df7e2e74af013a4ca8b945df064 100644 (file)
@@ -967,6 +967,7 @@ void network_config_management(char *entrytype, char *comment) {
        if (editor_pid == 0) {
                chmod(filename, 0600);
                sttybbs(SB_RESTORE);
+               setenv("WINDOW_TITLE", "Network configuration", 1);
                execlp(editor_path, editor_path, filename, NULL);
                exit(1);
        }