[xiph-commits] r18900 - icecast/trunk/log

ph3-der-loewe at svn.xiph.org ph3-der-loewe at svn.xiph.org
Tue Apr 2 05:17:43 PDT 2013


Author: ph3-der-loewe
Date: 2013-04-02 05:17:43 -0700 (Tue, 02 Apr 2013)
New Revision: 18900

Modified:
   icecast/trunk/log/log.c
Log:
allow space in format string for %H to allow spaces in output

Modified: icecast/trunk/log/log.c
===================================================================
--- icecast/trunk/log/log.c	2013-04-02 11:51:47 UTC (rev 18899)
+++ icecast/trunk/log/log.c	2013-04-02 12:17:43 UTC (rev 18900)
@@ -423,6 +423,7 @@
     int in_block = 0;
     int block_size = 0;
     int block_len;
+    int block_space = 0;
     const char * arg;
     char buf[80];
 
@@ -434,6 +435,7 @@
                 in_block = 1;
                 block_size = 0;
                 block_len  = 0;
+                block_space = 0;
             }
             else
             {
@@ -456,6 +458,9 @@
                 case '*':
                     block_len = va_arg(ap, int);
                     break;
+                case ' ':
+                    block_space = 1;
+                    break;
                 case '1':
                 case '2':
                 case '3':
@@ -519,7 +524,7 @@
                     {
                         for (; *arg && block_len && size; arg++, size--, block_len--)
                         {
-                            if (*arg <= '"' || *arg == '`'  || *arg == '\\')
+                            if ((*arg <= '"' || *arg == '`'  || *arg == '\\') && !(block_space && *arg == ' '))
                                 *(str++) = '.';
                             else
                                 *(str++) = *arg;



More information about the commits mailing list