905-file-segfault.dpatch 686 B

12345678910111213141516171819202122
  1. #!/bin/sh /usr/share/dpatch/dpatch-run
  2. ## 905-file-segfault.dpatch by Sven Anders <anders@anduras.de>
  3. ##
  4. ## DP: Fixes a segfault with -c.
  5. @DPATCH@
  6. diff -Naur file-4.20.orig/src/print.c file-4.20/src/print.c
  7. --- file-4.20.orig/src/print.c 2007-01-18 05:45:35.000000000 +0000
  8. +++ file-4.20/src/print.c 2007-05-17 16:39:17.000000000 +0000
  9. @@ -179,7 +179,10 @@
  10. /* cuz we use stdout for most, stderr here */
  11. (void) fflush(stdout);
  12. - (void) fprintf(stderr, "%s, %lu: Warning ", ms->file,
  13. + if (!ms->file)
  14. + fprintf(stderr, "Warning ");
  15. + else
  16. + (void) fprintf(stderr, "%s, %lu: Warning ", ms->file,
  17. (unsigned long)ms->line);
  18. (void) vfprintf(stderr, f, va);
  19. va_end(va);