lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV export language to lynxcgi environment


From: David Trueman
Subject: LYNX-DEV export language to lynxcgi environment
Date: Fri, 6 Dec 1996 23:31:58 -0400

The following patch exports the current language preference into the lynxcgi
environment as HTTP_ACCEPT_LANGUAGE so that lynxcgi scripts can react to 
the language preference in the same way a server-run CGI script would.

  David Trueman,
    Systems Manager, Dalhousie Math, Stats and Computing Science
    Technical Chair, Chebucto Community Net

*** dist/src/LYCgi.c    Mon Oct  2 07:38:28 1944
--- local/lynx2-6/src/LYCgi.c   Wed Dec  4 16:21:38 1996
***************
*** 296,301 ****
--- 298,304 ----
                char post_len[32];
                int argv_cnt = 3; /* name, one arg and terminator */
                char **cur_argv = NULL;
+               char buf[BUFSIZ];
  
                /* Set up output pipe */
                close(fd2[0]);
***************
*** 304,309 ****
--- 307,314 ----
                close(fd2[1]);
                
                
+               sprintf(buf, "HTTP_ACCEPT_LANGUAGE=%.*s", sizeof(buf)-30, 
language);
+               add_environment_value(buf);
                if (anAnchor->post_data) { /* post script, read stdin */
                    close(fd1[1]);
                    dup2(fd1[0], fileno(stdin));
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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