poldek: poldek/pm/rpm/rpminstall.c - log's "endlineness"

mis mis at pld-linux.org
Fri Jul 6 01:17:09 CEST 2007


Author: mis                          Date: Thu Jul  5 23:17:09 2007 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- log's "endlineness"

---- Files affected:
poldek/poldek/pm/rpm:
   rpminstall.c (1.22 -> 1.23) 

---- Diffs:

================================================================
Index: poldek/poldek/pm/rpm/rpminstall.c
diff -u poldek/poldek/pm/rpm/rpminstall.c:1.22 poldek/poldek/pm/rpm/rpminstall.c:1.23
--- poldek/poldek/pm/rpm/rpminstall.c:1.22	Sun Jul  1 23:04:27 2007
+++ poldek/poldek/pm/rpm/rpminstall.c	Fri Jul  6 01:17:04 2007
@@ -89,14 +89,21 @@
                 break;
 
         } else if (rc > 0) {
-            char  buf[4096];
+            char  buf[4096], *fmt = "_%s";
             int   n, i;
 
             if ((n = read(st->fd, buf, sizeof(buf) - 1)) <= 0)
                 break;
             
             buf[n] = '\0';
-            msg_tty(verbose_level, "_%s", buf);
+            if (buf[n - 1] == '\n') {
+                n--;
+                buf[n] = '\0';
+                fmt = "_%s\n";
+            }
+            
+            msg_tty(verbose_level, fmt, buf);
+
             /* logged to file? -> prefix lines with 'rpm: ' */
             for (i=0; i < n; i++) {
                 int c = buf[i];
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/poldek/poldek/pm/rpm/rpminstall.c?r1=1.22&r2=1.23&f=u



More information about the pld-cvs-commit mailing list