unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#32711] [PATCH] ui: Fix abort on #\nul character in build output.
@ 2018-09-12  2:38 ericbavier
  2018-09-28 21:14 ` bug#32711: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: ericbavier @ 2018-09-12  2:38 UTC (permalink / raw)
  To: 32711; +Cc: Eric Bavier

From: Eric Bavier <bavier@member.fsf.org>

Fixes build of "lz4" package, e.g.

* guix/ui.scm (build-output-port)[handle-string]: Check for #\nul before doing
any regex matching.
---
 guix/ui.scm | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index c55ae7e2f..207aba8ad 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1762,18 +1762,19 @@ phase announcements and replaces any other output with a spinner."
                      RED BLUE RED BLUE RED BLUE))))
       (lambda (str)
         (let ((processed
-               (any (match-lambda
-                      ((pattern #:transform transform)
-                       (and=> (string-match pattern str)
-                              transform))
-                      ((pattern . colors)
-                       (and=> (string-match pattern str)
-                              (lambda (m)
-                                (let ((substrings
-                                       (map (cut match:substring m <>)
-                                            (iota (- (match:count m) 1) 1))))
-                                  (string-join (map proc substrings colors) ""))))))
-                    rules)))
+               (and (not (string-index str #\nul)) ;(ice-9 regex) cannot handle #\nul
+                    (any (match-lambda
+                          ((pattern #:transform transform)
+                           (and=> (string-match pattern str)
+                                  transform))
+                          ((pattern . colors)
+                           (and=> (string-match pattern str)
+                                  (lambda (m)
+                                    (let ((substrings
+                                           (map (cut match:substring m <>)
+                                                (iota (- (match:count m) 1) 1))))
+                                      (string-join (map proc substrings colors) ""))))))
+                         rules))))
           (when spun?
             (display (string #\backspace) port))
           (if processed
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#32711: [PATCH] ui: Fix abort on #\nul character in build output.
  2018-09-12  2:38 [bug#32711] [PATCH] ui: Fix abort on #\nul character in build output ericbavier
@ 2018-09-28 21:14 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2018-09-28 21:14 UTC (permalink / raw)
  To: ericbavier; +Cc: 32711-done, Eric Bavier

Hi Eric,

ericbavier@centurylink.net skribis:

> From: Eric Bavier <bavier@member.fsf.org>
>
> Fixes build of "lz4" package, e.g.
>
> * guix/ui.scm (build-output-port)[handle-string]: Check for #\nul before doing
> any regex matching.

This is fixed in the new (guix status) code, commit
dc0f74e5fc26977a3ee6c4f2aa74a141f4359982 (see the ‘color-rules’ macro.)

Thank you, and sorry for not responding earlier!

Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-28 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-12  2:38 [bug#32711] [PATCH] ui: Fix abort on #\nul character in build output ericbavier
2018-09-28 21:14 ` bug#32711: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).