From: Roland Häder Date: Mon, 4 Apr 2011 23:19:43 +0000 (+0000) Subject: - Added a helper script to ease applying patches X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8dc5316bec97fe71f141cde5f34c471eff02c689;p=core.git - Added a helper script to ease applying patches - Fixed naming of a variable $deg->dec - Hexadecimal strings are now prepended with a '0' if the length cannot be devided by 2 --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index c5b4ebe0..aa64808e 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -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 index 00000000..725fc72a --- /dev/null +++ b/patch_i.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +patch -p0 < i || exit 10 +svn commit || exit 10 +rm i