#----------------------------------------------------------------
#              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 14.2"
#
# Thanks to:
# Jeroen van Nieuwenhuizen:    http://www.jeroen.se/
# Thomas Wiegner:              http://www.foory.de/thw/slrn/
#
# Patch by Andrew Strong:      http://www.andrews-corner.org
#
# 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
# 08 Oct 2014:  Tested against slrn 1.0.2
# 28 Oct 2016:  Tested against slrn 1.0.3
----------------------------------------------------------------
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
