From c6f2404db813aeb4651115c796d06acfc35c8d24 Mon Sep 17 00:00:00 2001
From: Bob Vincent <bobvin@pillars.net>
Date: Sat, 18 Jun 2011 01:33:49 -0400
Subject: [PATCH] Issue #1192470 by pillarsdotnet: Make drupal_realpath() code match the docs.

---
 includes/file.inc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/includes/file.inc b/includes/file.inc
index 4750ff481fe297ea9581782b1f71ba9207d8043c..77164c7a4109ed1d54ebdcfaab47a7fc20b3c72e 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -2162,7 +2162,11 @@ function drupal_unlink($uri, $context = NULL) {
  * @see realpath()
  * @ingroup php_wrappers
  */
-function drupal_realpath($uri) {
+function drupal_realpath($uri = NULL) {
+  // Build a target URI if necessary.
+  if (!isset($uri)) {
+    $uri = file_build_uri();
+  }
   // If this URI is a stream, pass it off to the appropriate stream wrapper.
   // Otherwise, attempt PHP's realpath. This allows use of drupal_realpath even
   // for unmanaged files outside of the stream wrapper interface.
-- 
1.7.4.1

