1
0

012-strip-trailing-conffiles-whitespace.patch 635 B

1234567891011121314151617181920212223
  1. --- a/libopkg/opkg_install.c
  2. +++ b/libopkg/opkg_install.c
  3. @@ -274,6 +274,7 @@ unpack_pkg_control_files(pkg_t *pkg)
  4. while (1) {
  5. char *cf_name;
  6. char *cf_name_in_dest;
  7. + int i;
  8. cf_name = file_read_line_alloc(conffiles_file);
  9. if (cf_name == NULL) {
  10. @@ -282,6 +283,12 @@ unpack_pkg_control_files(pkg_t *pkg)
  11. if (cf_name[0] == '\0') {
  12. continue;
  13. }
  14. + for (i = strlen(cf_name) - 1;
  15. + (i >= 0) && (cf_name[i] == ' ' || cf_name[i] == '\t');
  16. + i--
  17. + ) {
  18. + cf_name[i] = '\0';
  19. + }
  20. /* Prepend dest->root_dir to conffile name.
  21. Take pains to avoid multiple slashes. */