svn commit: r335692 - in head/sys: kern sys

Warner Losh imp at FreeBSD.org
Wed Jun 27 04:11:21 UTC 2018


Author: imp
Date: Wed Jun 27 04:11:19 2018
New Revision: 335692
URL: https://svnweb.freebsd.org/changeset/base/335692

Log:
  Remove devctl_safe_quote since it's now unused.
  
  Sponsored by: Netflix
  Differential Review: https://reviews.freebsd.org/D16026

Modified:
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Wed Jun 27 04:11:14 2018	(r335691)
+++ head/sys/kern/subr_bus.c	Wed Jun 27 04:11:19 2018	(r335692)
@@ -860,38 +860,6 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS)
  * Strings are always terminated with a NUL, but may be truncated if longer
  * than @p len bytes after quotes.
  *
- * @param dst	Buffer to hold the string. Must be at least @p len bytes long
- * @param src	Original buffer.
- * @param len	Length of buffer pointed to by @dst, including trailing NUL
- */
-void
-devctl_safe_quote(char *dst, const char *src, size_t len)
-{
-	char *walker = dst, *ep = dst + len - 1;
-
-	if (len == 0)
-		return;
-	while (src != NULL && walker < ep)
-	{
-		if (*src == '"' || *src == '\\') {
-			if (ep - walker < 2)
-				break;
-			*walker++ = '\\';
-		}
-		*walker++ = *src++;
-	}
-	*walker = '\0';
-}
-
-/**
- * @brief safely quotes strings that might have double quotes in them.
- *
- * The devctl protocol relies on quoted strings having matching quotes.
- * This routine quotes any internal quotes so the resulting string
- * is safe to pass to snprintf to construct, for example pnp info strings.
- * Strings are always terminated with a NUL, but may be truncated if longer
- * than @p len bytes after quotes.
- *
  * @param sb	sbuf to place the characters into
  * @param src	Original buffer.
  */

Modified: head/sys/sys/bus.h
==============================================================================
--- head/sys/sys/bus.h	Wed Jun 27 04:11:14 2018	(r335691)
+++ head/sys/sys/bus.h	Wed Jun 27 04:11:19 2018	(r335692)
@@ -156,7 +156,6 @@ void devctl_notify(const char *__system, const char *_
     const char *__type, const char *__data);
 void devctl_queue_data_f(char *__data, int __flags);
 void devctl_queue_data(char *__data);
-void devctl_safe_quote(char *__dst, const char *__src, size_t __len);
 struct sbuf;
 void devctl_safe_quote_sb(struct sbuf *__sb, const char *__src);
 


More information about the svn-src-head mailing list