Re: X header in postings

Heinz Diehl <[email protected]>
Newsgroups gmane.network.slrn.user
Organization private site
Message-ID <[email protected]>
On 09.11.2009, Michael Wagner wrote: 

> is it possible in 'slrn' that it expands variables in the headers like
> for example 'mutt'?

Not as far as I know.

> my_hdr X-Operating-System: Debian GNU/`uname -s` `cat /etc/debian_version` `uname -r`

How about something like this (untested):

--- post.c.321	2009-11-09 17:07:05.000000000 +0100
+++ post.c	2009-11-09 17:05:04.000000000 +0100
@@ -70,11 +70,13 @@
 #include "strutil.h"
 #include "common.h"
 #include "hdrutils.h"
-
+#include <sys/utsname.h>
 /*}}}*/
 
 #define MAX_LINE_BUFLEN	2048
 
+struct utsname uts;
+
 /*{{{ Public Global Variables */
 char *Slrn_CC_Post_Message = NULL;
 char *Slrn_Failed_Post_Filename;
@@ -822,10 +824,10 @@
 	     goto return_error;
 	  }
      }
-
+   uname (&uts);
    if ((NULL == (tmp = slrn_gen_date_header ()))
        || (NULL == slrn_append_to_header (a, tmp, 1))
-       || (NULL == (tmp = slrn_strdup_printf("User-Agent: slrn/%s (%s)", Slrn_Version_String, system_os_name)))
+       || (NULL == (tmp = slrn_strdup_printf("User-Agent: slrn/%s (Debian GNU/%s %s)", Slrn_Version_String, uts.sysname, uts.release)))
        || (NULL == slrn_append_to_header (a, tmp, 1))
        || (NULL == slrn_append_to_header (a, NULL,0)))   /* separator */
      {


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.