[prev in list] [next in list] [prev in thread] [next in thread] 

List:       subversion-dev
Subject:    [PATCH] set_up_diff_cmd_and_options() doesn't accept NULL config
From:       "Kouhei Sutou" <kou () cozmixng ! org>
Date:       2008-03-28 7:03:57
Message-ID: a799fada0803280003m493b64c0pd4a660add161bba8 () mail ! gmail ! com
[Download RAW message or body]

Hi,

set_up_diff_cmd_and_options()'s document says:

/* Initialize DIFF_CMD_BATON.diff_cmd and DIFF_CMD_BATON.options,
 * according to OPTIONS and CONFIG.  CONFIG may be null.
 * Allocate the fields in POOL, which should be at least as long-lived
 * as the pool DIFF_CMD_BATON itself is allocated in.
 */

But it doesn't accept NULL as CONFIG.

Thanks,
--
kou

["svn-accept-null.diff" (text/x-diff)]

Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c	(revision 30096)
+++ subversion/libsvn_client/diff.c	(working copy)
@@ -1489,13 +1489,17 @@
                             const apr_array_header_t *options,
                             apr_hash_t *config, apr_pool_t *pool)
 {
-  const char *diff_cmd;
+  const char *diff_cmd = NULL;
   
-  /* See if there is a command. */
-  svn_config_t *cfg = apr_hash_get(config, SVN_CONFIG_CATEGORY_CONFIG,
-                                   APR_HASH_KEY_STRING);
-  svn_config_get(cfg, &diff_cmd, SVN_CONFIG_SECTION_HELPERS,
-                 SVN_CONFIG_OPTION_DIFF_CMD, NULL);
+  if (config)
+    {
+      /* See if there is a command. */
+      svn_config_t *cfg = apr_hash_get(config, SVN_CONFIG_CATEGORY_CONFIG,
+                                       APR_HASH_KEY_STRING);
+      svn_config_get(cfg, &diff_cmd, SVN_CONFIG_SECTION_HELPERS,
+                     SVN_CONFIG_OPTION_DIFF_CMD, NULL);
+    }
+
   diff_cmd_baton->diff_cmd = diff_cmd;
 
   /* If there was a command, arrange options to pass to it. */


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic