[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LYNX-DEV suggestion to provide command line argument to lynx for setting
From: |
Merlin Mathesius |
Subject: |
LYNX-DEV suggestion to provide command line argument to lynx for setting User-Agent header |
Date: |
Tue, 24 Feb 98 09:58:49 -0600 |
Greetings,
I would like to suggest/request that a command line argument be officially
added to Lynx to support the setting of the "User-Agent" header.
There is already an interactive way to set the "User-Agent" value through the
options screen, but my application for using an alternate header needs to be
scripted. And the addition of just a few lines of code seems to take care of
this quite nicely! Below, I've attached a context diff of the source code
change I made to Lynx 2.7.2 to do just this.
Thanks for listening!
Sincerely,
Merlin J. Mathesius
Perot Systems Corporation at SBCWDR
P.S. I just noticed something in the code snippet below. Isn't there a bug
in the following line:
if (strncmp(argv[0], "-underscore", 15) == 0) {
shouldn't this be:
if (strncmp(argv[0], "-underscore", 11) == 0) {
????!!!!
--------------------------------SNIP--------------------------------
*** src/LYMain.c.ORIG Mon Dec 22 18:40:06 1997
--- src/LYMain.c Mon Feb 23 14:35:16 1998
***************
*** 2383,2396 ****
--- 2383,2403 ----
case 'u':
if (strncmp(argv[0], "-underscore", 15) == 0) {
if (use_underscore)
use_underscore = FALSE;
else
use_underscore = TRUE;
+ } else if (strncmp(argv[0], "-useragent", 10) == 0) {
+ /*
+ * Set alternate Lynx User-Agent header.
+ */
+ if (nextarg)
+ StrAllocCopy(LYUserAgent, cp);
+
} else {
goto Output_Error_and_Help_List;
}
break;
case 'v':
if (strcmp(argv[0], "-validate") == 0) {
--------------------------------SNIP--------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- LYNX-DEV suggestion to provide command line argument to lynx for setting User-Agent header,
Merlin Mathesius <=