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