Re: [PATCH 2/2] rework menu so that it can support multiline titles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>  > We have the strim() function for this purpose.
>>
>>   * strim - Removes leading and trailing whitespace from @s.
>>
>>  And mine does only:
>>  >> + /* Remove trailing whitespaces */
>
> You can use strim for both cases:
>
>         str = strim(str);
>
> removes both leading and trailing whitespaces, but without reassigning
> str to the return value of strim() you only remove trailing whitespaces.

Well, this is rather hack than normal using.
Because this way of using has nothing to do with the description:

 * strim - Removes leading and trailing whitespace from @s.
 * @s: The string to be stripped.
 * Returns a pointer to the first non-whitespace character in @s.

Here is the patch which removes this misunderstanding:

diff --git a/lib/string.c b/lib/string.c
index a3e9fd8..1d491c9 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -641,7 +641,7 @@ char *skip_spaces(const char *str)
 }

 /**
- * strim - Removes leading and trailing whitespace from @s.
+ * strim - Removes trailing whitespace from @s.
  * @s: The string to be stripped.
  *
  * Note that the first trailing whitespace is replaced with a %NUL-terminator

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux