Made config->base_url() accept parameters. config->base_url($uri).  Updated base_url() in url_helper accordingly.
diff --git a/system/core/Config.php b/system/core/Config.php
index da22222..554b736 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -194,10 +194,7 @@
 	// --------------------------------------------------------------------
 
 	/**
-	 * Fetch a config file item - adds slash after item
-	 *
-	 * The second parameter allows a slash to be added to the end of
-	 * the item, in the case of a path.
+	 * Fetch a config file item - adds slash after item (if item is not empty)
 	 *
 	 * @access	public
 	 * @param	string	the config item name
@@ -210,6 +207,10 @@
 		{
 			return FALSE;
 		}
+		if( trim($this->config[$item]) == '')
+		{
+			return '';
+		}
 
 		return rtrim($this->config[$item], '/').'/';
 	}
@@ -218,6 +219,7 @@
 
 	/**
 	 * Site URL
+	 * Returns base_url . index_page [. uri_string]
 	 *
 	 * @access	public
 	 * @param	string	the URI string
@@ -232,14 +234,48 @@
 
 		if ($this->item('enable_query_strings') == FALSE)
 		{
+			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
+			return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix;
+		}
+		else
+		{
+			return $this->slash_item('base_url').$this->item('index_page').'?'.$this->_uri_string($uri);
+		}
+	}
+	
+	// -------------------------------------------------------------
+	
+	/**
+	 * Base URL
+	 * Returns base_url [. uri_string]
+	 * 
+	 * @access public
+	 * @param string $uri
+	 * @return string
+	 */
+	function base_url($uri = '')
+	{
+		return $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/');
+	}
+	
+	// -------------------------------------------------------------
+	
+	/**
+	 * Build URI string for use in Config::site_url() and Config::base_url()
+	 * 
+	 * @access protected
+	 * @param  $uri
+	 * @return string
+	 */
+	protected function _uri_string($uri)
+	{
+		if ($this->item('enable_query_strings') == FALSE)
+		{
 			if (is_array($uri))
 			{
 				$uri = implode('/', $uri);
 			}
-
-			$index = $this->item('index_page') == '' ? '' : $this->slash_item('index_page');
-			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
-			return $this->slash_item('base_url').$index.trim($uri, '/').$suffix;
+			$uri = trim($uri, '/');
 		}
 		else
 		{
@@ -253,16 +289,14 @@
 					$str .= $prefix.$key.'='.$val;
 					$i++;
 				}
-
 				$uri = $str;
 			}
-
-			return $this->slash_item('base_url').$this->item('index_page').'?'.$uri;
 		}
+	    return $uri;
 	}
 
 	// --------------------------------------------------------------------
-
+	
 	/**
 	 * System URL
 	 *
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index d0516ce..9f4b852 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -50,18 +50,21 @@
 
 /**
  * Base URL
- *
- * Returns the "base_url" item from your config file
+ * 
+ * Create a local URL based on your basepath.
+ * Segments can be passed in as a string or an array, same as site_url
+ * or a URL to a file can be passed in, e.g. to an image file.
  *
  * @access	public
+ * @param string
  * @return	string
  */
 if ( ! function_exists('base_url'))
 {
-	function base_url()
+	function base_url($uri = '')
 	{
 		$CI =& get_instance();
-		return $CI->config->slash_item('base_url');
+		return $CI->config->base_url($uri);
 	}
 }