recode-3.6-segfault.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Recode segfaulted on C files (bnc#503437)
  2. # Eg. file containing just a single apostrophe ('), or openinig C comment (/*)
  3. # This is a simple workaround.
  4. diff -u -r recode-3.6/src/main.c recode-fajn/src/main.c
  5. --- src/main.c.orig 2000-12-06 20:44:59.000000000 +0100
  6. +++ src/main.c 2010-12-30 16:07:03.973840778 +0100
  7. @@ -951,17 +951,26 @@
  8. success = false;
  9. if (verbose_flag)
  10. {
  11. - fprintf (stderr, _(" failed: %s in step `%s..%s'\n"),
  12. + if (task->error_at_step)
  13. + fprintf (stderr, _(" failed: %s in step `%s..%s'\n"),
  14. task_perror (task),
  15. task->error_at_step->before->name,
  16. task->error_at_step->after->name);
  17. + else
  18. + fprintf (stderr, _(" failed: Unknown error\n"));
  19. +
  20. fflush (stderr);
  21. }
  22. else if (!quiet_flag)
  23. - error (0, 0, _("%s failed: %s in step `%s..%s'"),
  24. + {
  25. + if (task->error_at_step)
  26. + error (0, 0, _("%s failed: %s in step `%s..%s'"),
  27. input_name, task_perror (task),
  28. task->error_at_step->before->name,
  29. task->error_at_step->after->name);
  30. + else
  31. + error (0, 0, _("%s failed: Unknown error"), input_name);
  32. + }
  33. unlink (output_name);
  34. }
  35. @@ -981,10 +990,15 @@
  36. {
  37. success = false;
  38. if (!quiet_flag)
  39. - error (0, 0, _("%s in step `%s..%s'"),
  40. + {
  41. + if (task->error_at_step)
  42. + error (0, 0, _("%s in step `%s..%s'"),
  43. task_perror (task),
  44. task->error_at_step->before->name,
  45. task->error_at_step->after->name);
  46. + else
  47. + error (0, 0, _("Unknown error"));
  48. + }
  49. }
  50. }
  51. }
  52. Only in recode-fajn/src: tags