001-gm_utils.cpp-Call-clear-instead-of-empty.patch 883 B

12345678910111213141516171819202122232425
  1. From bfba6445a778007f40af5cbfbe725e12c0fcafc6 Mon Sep 17 00:00:00 2001
  2. From: Tomas Volf <[email protected]>
  3. Date: Tue, 5 Mar 2024 22:25:20 +0100
  4. Subject: [PATCH] gm_utils.cpp: Call clear instead of empty.
  5. Since the intention seem to be to erase the next word, I believe calling empty
  6. was a mistake and it should have been clear. Empty does nothing in this
  7. context.
  8. * src/gm_utils.cpp (wrap_cstr): Call clear.
  9. ---
  10. src/gm_utils.cpp | 2 +-
  11. 1 file changed, 1 insertion(+), 1 deletion(-)
  12. --- a/src/gm_utils.cpp
  13. +++ b/src/gm_utils.cpp
  14. @@ -311,7 +311,7 @@ void wrap_cstr(string& wrapped, unsigned
  15. // trim leading spaces
  16. std::size_t pos = next_word.find_first_not_of(' ');
  17. if( pos == std::string::npos )
  18. - next_word.empty();
  19. + next_word.clear();
  20. else if( pos )
  21. next_word.erase( 0, pos );