remove dead code
authorJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 18:32:47 +0000 (13:32 -0500)
committerJohn (J5) Palmieri <johnp@redhat.com>
Tue, 15 Jan 2008 18:32:47 +0000 (13:32 -0500)
2008-01-15  John (J5) Palmieri  <johnp@redhat.com>

* patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>

* bus/config-parser.c (locate_attributes): remove dead code which
always evaluated to TRUE

* dbus/dbus-shell.c (_dbus_shell_quote): remove unused code

ChangeLog
bus/config-parser.c
dbus/dbus-shell.c
dbus/dbus-shell.h

index 32beee7..58c63bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-01-15  John (J5) Palmieri  <johnp@redhat.com>
+
+       * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
+
+       * bus/config-parser.c (locate_attributes): remove dead code which
+       always evaluated to TRUE
+
+       * dbus/dbus-shell.c (_dbus_shell_quote): remove unused code
+
 2008-01-14  John (J5) Palmieri  <johnp@redhat.com>
 
        * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
index d6df4ab..f9e0b7d 100644 (file)
@@ -582,9 +582,6 @@ locate_attributes (BusConfigParser  *parser,
 
   va_end (args);
 
-  if (!retval)
-    return retval;
-
   i = 0;
   while (attribute_names[i])
     {
index 9028424..65038b1 100644 (file)
@@ -140,72 +140,6 @@ unquote_string_inplace (char* str, char** end)
   return FALSE;
 }
 
-/**
- * Quotes a string so that the shell (/bin/sh) will interpret the
- * quoted string to mean @unquoted_string. If you pass a filename to
- * the shell, for example, you should first quote it with this
- * function.  The return value must be freed with dbus_free(). The
- * quoting style used is undefined (single or double quotes may be
- * used).
- * 
- * @unquoted_string: a literal string
- **/
-char*
-_dbus_shell_quote (const char *unquoted_string)
-{
-  /* We always use single quotes, because the algorithm is cheesier.
-   * We could use double if we felt like it, that might be more
-   * human-readable.
-   */
-
-  const char *p;
-  char *ret;
-  DBusString dest;
-  
-  _dbus_string_init (&dest);
-
-  p = unquoted_string;
-
-  /* could speed this up a lot by appending chunks of text at a
-   * time.
-   */
-  while (*p)
-    {
-      /* Replace literal ' with a close ', a \', and a open ' */
-      if (*p == '\'')
-       {
-         if (!_dbus_string_append (&dest, "'\\''"))
-           {
-             _dbus_string_free (&dest);
-             return NULL;
-           }
-       }
-      else
-       {
-         if (!_dbus_string_append_byte (&dest, *p))
-           {
-             _dbus_string_free (&dest);
-             return NULL;
-           }
-       }
-
-      ++p;
-    }
-
-  /* close the quote */
-  if (_dbus_string_append_byte (&dest, '\''))
-    {
-      ret = _dbus_strdup (_dbus_string_get_data (&dest));
-      _dbus_string_free (&dest);
-
-      return ret;
-    }
-
-  _dbus_string_free (&dest);
-
-  return NULL;
-}
-
 /** 
  * Unquotes a string as the shell (/bin/sh) would. Only handles
  * quotes; if a string contains file globs, arithmetic operators,
index 9ecdf06..5316d51 100644 (file)
@@ -28,7 +28,6 @@
 
 DBUS_BEGIN_DECLS
 
-char*       _dbus_shell_quote      (const char *unquoted_string);
 char*       _dbus_shell_unquote    (const char *quoted_string);
 dbus_bool_t _dbus_shell_parse_argv (const char *command_line,
                                     int        *argcp,