Article View: news.software.readers
Article #257158Re: [slrn] custom_os.patch still working?
From: andrew
Date: Fri, 21 Mar 2014 07:10
Date: Fri, 21 Mar 2014 07:10
107 lines
4535 bytes
4535 bytes
On 2014-03-01, Mike Yetto <unet.lighthouse@xoxy.net> wrote:
> Mike "unless you finally catch andrew's eye" Yetto
The patch will probably still work although I have not tested it for a
while. My website, where the patch normally lived, is gone but here is
the most recent version of the patch:
#v+
#----------------------------------------------------------------
# custom_os patch for slrn
#----------------------------------------------------------------
#
# This patch adds the ability to alter the "Operating System"
# section of the User-Agent header generated by slrn. The patch
# allows this to be manipulated from the .slrnrc file as follows:
#
# set custom_os "Slackware 13.1"
#
# Thanks to:
# Jeroen van Nieuwenhuizen: http://www.jeroen.se/
# Thomas Wiegner: http://www.foory.de/thw/slrn/
#
# Patch by Andrew Strong
#
# Changelog:
# 01 Jul 2008: First working version
# 22 Aug 2008: Added TW's 'branding scheme' to version.c
# 16 Apr 2010: Small line adjustment for current svn
# 25 Apr 2013: Adjustment for current git slrn
----------------------------------------------------------------
diff --git a/src/post.c b/src/post.c
index 0f30f85..d12628f 100644
--- a/src/post.c
+++ b/src/post.c
@@ -76,6 +76,7 @@
#define MAX_LINE_BUFLEN 2048
/*{{{ Public Global Variables */
+char *Slrn_Custom_OS_Name;
char *Slrn_CC_Post_Message = NULL;
char *Slrn_Failed_Post_Filename;
char *Slrn_Post_Custom_Headers;
@@ -664,7 +665,14 @@ static int prepare_header (VFILE *vp, unsigned int *linenum, Slrn_Article_Type *
Slrn_Mime_Error_Obj *mime_err;
char *tmp, *system_os_name;
- system_os_name = slrn_get_os_name ();
+ if (Slrn_Custom_OS_Name == NULL)
+ {
+ system_os_name = slrn_get_os_name ();
+}
+ else
+ {
+ system_os_name = Slrn_Custom_OS_Name;
+}
#if SLRN_HAS_STRICT_FROM
if (NULL != (tmp = slrn_make_from_header ()))
diff --git a/src/post.h b/src/post.h
index 1b69372..95a6f22 100644
--- a/src/post.h
+++ b/src/post.h
@@ -18,6 +18,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+extern char *Slrn_Custom_OS_Name;
extern int slrn_add_signature (FILE *);
extern char *slrn_gen_date_header (void);
extern int slrn_add_custom_headers (FILE *, char *, int (*)(char *, FILE *));
diff --git a/src/startup.c b/src/startup.c
index 76162fb..b68a904 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -719,6 +719,7 @@ static int get_set_macro_dir (Slrn_Str_Var_Type *sv, int set, char **valp)
Slrn_Str_Var_Type Slrn_Str_Variables [] = /*{{{*/
{
+ {"custom_os", &Slrn_Custom_OS_Name, NULL},
{"failed_posts_file", &Slrn_Failed_Post_Filename, NULL},
#if ! SLRN_HAS_STRICT_FROM
{"hostname", &Slrn_User_Info.hostname, NULL},
diff --git a/src/version.c b/src/version.c
index 79bfe18..979eb6c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -43,7 +43,8 @@
#include "art.h"
#include "snprintf.h"
-char *Slrn_Version_String = SLRN_VERSION_STRING;
+#define SLRN_VERSION_STRING_AS SLRN_VERSION_STRING"/co"
+char *Slrn_Version_String = SLRN_VERSION_STRING_AS;
int Slrn_Version = SLRN_VERSION;
typedef struct
#v-
I leave this copy here for others to work with if they wish, it
certainly was a lot of fun putting it together all that time ago :)
Andrew
--
Do you think that's air you're breathing?
Technical Details
Message-ID:
<20140321180449.659@skamandros.andrews-corner.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!bolzen.all.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<leeuck$pgv$1@reader1.panix.com> <slrn20140301171755.661.twooffive@may.eternal-september.org>Show Full Headers
Complete Article Headers
Message-ID: <20140321180449.659@skamandros.andrews-corner.org> Subject: Re: [slrn] custom_os.patch still working? Date: Fri, 21 Mar 2014 07:10:15 +0000 From: andrew <andrew@skamandros.invalid> References: <leeuck$pgv$1@reader1.panix.com> <slrn20140301171755.661.twooffive@may.eternal-september.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!bolzen.all.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Newsgroups: news.software.readers Organization: slrn mafia Lines: 107 X-Trace: individual.net 5nD2qlZlsLtiNpeI0IgyKAcOyRSW4n/ksbT5pU0UchUoJF7S+U Cancel-Lock: sha1:jxFuGjvrB2YTCR0n6r4zLBsAdTQ= User-Agent: slrn/pre1.0.2-12 (Win32) X-Original-Bytes: 4228