0003-Revert-libbb-remove-unnecessary-variable-in-xmalloc_.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 0d598ab9f03dbf320f7b81c05e4a94cb303dfbc7 Mon Sep 17 00:00:00 2001
  2. From: Denys Vlasenko <vda.linux@googlemail.com>
  3. Date: Sun, 2 Sep 2018 18:35:29 +0200
  4. Subject: [PATCH] Revert "libbb: remove unnecessary variable in xmalloc_fgets"
  5. The variable is in fact necessary.
  6. commit 2da9724b56169f00bd7fb6b9a11c9409a7620981
  7. Author: Quentin Rameau <quinq@fifth.space>
  8. Date: Sun Apr 1 17:05:35 2018 +0200
  9. libbb: remove unnecessary variable in xmalloc_fgets
  10. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
  11. [Thomas De Schampheleire: added to unbreak 'head -n -1',
  12. see http://lists.busybox.net/pipermail/busybox/2018-August/086617.html ]
  13. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
  14. ---
  15. libbb/get_line_from_file.c | 4 +++-
  16. 1 file changed, 3 insertions(+), 1 deletion(-)
  17. diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
  18. index f3d6c6203..49ef093c2 100644
  19. --- a/libbb/get_line_from_file.c
  20. +++ b/libbb/get_line_from_file.c
  21. @@ -47,7 +47,9 @@ char* FAST_FUNC bb_get_chunk_from_file(FILE *file, size_t *end)
  22. /* Get line, including trailing \n if any */
  23. char* FAST_FUNC xmalloc_fgets(FILE *file)
  24. {
  25. - return bb_get_chunk_from_file(file, NULL);
  26. + int i;
  27. +
  28. + return bb_get_chunk_from_file(file, &i);
  29. }
  30. /* Get line. Remove trailing \n */
  31. char* FAST_FUNC xmalloc_fgetline(FILE *file)
  32. --
  33. 2.16.4