#229 ansi renderer coloring broken

Development Strand
open
nobody
None
5
2013-06-15
2013-06-13
Christian Weiske
No

The ANSI coloring is currently broken because the bit shifting operations are not enclosed with parentheses.

Patch:

Index: geshi/classes/renderers/class.geshirendereransi.php
===================================================================
--- geshi/classes/renderers/class.geshirendereransi.php (Revision 2577)
+++ geshi/classes/renderers/class.geshirendereransi.php (Arbeitskopie)
@@ -118,7 +118,7 @@
      */
     protected function getColorName($r, $g, $b)
     {
-        $col = $r<<16 + $g<<8 + $b;
+        $col = ($r<<16) + ($g<<8) + ($b);
         if (isset($this->colorCache[$col])) {
             return $this->colorCache[$col];
         }

Related

Bugs: #229

Discussion

  • BenBE
    BenBE
    2013-06-15

    Hi,

    hattest Du den schon eingebunden im SVN? Oder wartet der noch auf ein ACK?

    Gruß,
    BenBE

    Am 13.06.2013 15:26, schrieb Christian Weiske:


    [bugs:#229] http://sourceforge.net/p/geshi/bugs/229/ ansi renderer
    coloring broken

    Status: open
    Created: Thu Jun 13, 2013 01:26 PM UTC by Christian Weiske
    Last Updated: Thu Jun 13, 2013 01:26 PM UTC
    Owner: nobody

    The ANSI coloring is currently broken because the bit shifting
    operations are not enclosed with parentheses.

    Patch:

    Index: geshi/classes/renderers/class.geshirendereransi.php

    --- geshi/classes/renderers/class.geshirendereransi.php (Revision 2577)
    +++ geshi/classes/renderers/class.geshirendereransi.php (Arbeitskopie)
    @@ -118,7 +118,7 @@
    */
    protected function getColorName($r, $g, $b)
    {
    - $col = $r<<16 + $g<<8 + $b;
    + $col = ($r<<16) + ($g<<8) + ($b);
    if (isset($this->colorCache[$col])) {
    return $this->colorCache[$col];
    }


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/geshi/bugs/229/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #229

  • Nein, ich hatte das auf einem Rechner bemerkt, von dem aus ich keinen SVN-Commit-Zugriff hatte.

    Ich habs jetzt von meinem Laptop aus committet.

     
    Last edit: Christian Weiske 2013-06-15