- Added a helper script to ease applying patches
authorRoland Häder <roland@mxchange.org>
Mon, 4 Apr 2011 23:19:43 +0000 (23:19 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 4 Apr 2011 23:19:43 +0000 (23:19 +0000)
- Fixed naming of a variable $deg->dec
- Hexadecimal strings are now prepended with a '0' if the length cannot be
  devided by 2

inc/classes/main/class_BaseFrameworkSystem.php
patch_i.sh [new file with mode: 0755]

index c5b4ebe06a81c7077c2046dc99c9e3d0c00f3a9a..aa64808ec799516afa717c92c517f88d6642829f 100644 (file)
@@ -1649,6 +1649,15 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $dec /= 16;
                } while ($dec >= 1);
 
+               /*
+                * We need hexadecimal strings with leading zeros if the length cannot
+                * be divided by 2
+                */
+               if ((strlen($hex) % 2) != 0) {
+                       // Prepend a zero
+                       $hex = '0' . $hex;
+               } // END - if
+
                // Return the hexadecimal string
                return $sign . $hex;
        }
@@ -1676,9 +1685,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $dec    Decimal number
         * @return      $asc    An ASCII string
         */
-       public final function dec2asc ($deg) {
+       public final function dec2asc ($dec) {
                // First convert the number into a hexadecimal string
-               $hex = $this->dec2hex($deg);
+               $hex = $this->dec2hex($dec);
 
                // Then convert it into the ASCII string
                $asc = $this->hex2asc($hex);
@@ -1703,7 +1712,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                for ($idx = 0; $idx < strlen($hex); $idx+=2) {
                        // Get the decimal number of the chunk
                        $part = hexdec(substr($hex, $idx, 2));
-                       $this->debugOutput(__FUNCTION__ . ': part(' . strlen($part) . ')=' . $part);
 
                        // Add it to the final string
                        $asc .= chr($part);
diff --git a/patch_i.sh b/patch_i.sh
new file mode 100755 (executable)
index 0000000..725fc72
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+patch -p0 < i || exit 10
+svn commit || exit 10
+rm i