🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #257161

Re: [slrn] custom_os.patch still working?

#257161
From: Mike Yetto
Date: Fri, 21 Mar 2014 12:05
112 lines
5424 bytes
Bada bing andrew <andrew@skamandros.invalid> bada bang...
> 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 :)

Thank you once again, kind sir.

Mike "maybe I can get it working again" Yetto
-- 
"I had no shoes and I pitied myself.  Then I met a man who had no
feet, so I took his shoes."
 - Dave Barry
Technical Details
Message-ID: <slrn20140321080412.979.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.ams2.giganews.com!backlog3.nntp.ams3.giganews.com!backlog3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!may.eternal-september.org!.POSTED!not-for-mail
References: <leeuck$pgv$1@reader1.panix.com> <slrn20140301171755.661.twooffive@may.eternal-september.org> <20140321180449.659@skamandros.andrews-corner.org>

Show Full Headers
Complete Article Headers
Message-ID: <slrn20140321080412.979.twooffive@may.eternal-september.org>
Subject: Re: [slrn] custom_os.patch still working?
Date: Fri, 21 Mar 2014 08:05:56 -0400
From: Mike Yetto <unet.lighthouse@xoxy.net>
References: <leeuck$pgv$1@reader1.panix.com> <slrn20140301171755.661.twooffive@may.eternal-september.org> <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.ams2.giganews.com!backlog3.nntp.ams3.giganews.com!backlog3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!may.eternal-september.org!.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: slrn Mafia / Xnews Tong (emeritus)
Lines: 112
Injection-Info: may.eternal-september.org;
 posting-host="df04e6e302bfb58eb634c9843e746978";
 logging-data="18495"; mail-complaints-to="abuse@eternal-september.org";
 posting-account="U2FsdGVkX18pAGBs+4d3Bgr7XtlDwtwhMlqC4yf/i78="
User-Agent: slrn/pre1.0.2-12 (Linux)
X-The-Usenet-Improvement-Project: http://twovoyagers.com/improve-usenet.org/
X-No-Bananas: Yes (except Ray)
Cancel-Lock: sha1:CbnH9/TZ5u9LyINjIp3v3TJDsSY=
 sha1:fBig6HM61+ltbS9M+5G75Ouv0vQ=
X-Original-Bytes: 5142