Page MenuHomeFreeBSD

D49374.diff
No OneTemporary

D49374.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h
--- a/sys/compat/linuxkpi/common/include/linux/string.h
+++ b/sys/compat/linuxkpi/common/include/linux/string.h
@@ -161,6 +161,24 @@
return (__DECONST(char *, str));
}
+/*
+ * This function trims whitespaces at the end of a string and returns a pointer
+ * to the first non-whitespace character.
+ */
+static inline char *
+strim(char *str)
+{
+ char *end;
+
+ end = str + strlen(str);
+ while (end >= str && (*end == '\0' || isspace(*end))) {
+ *end = '\0';
+ end--;
+ }
+
+ return (skip_spaces(str));
+}
+
static inline void *
memchr_inv(const void *start, int c, size_t length)
{

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 6, 4:46 PM (2 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30985850
Default Alt Text
D49374.diff (709 B)

Event Timeline