1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_nicer_error_messages.dpatch by Bas Zoetekouw <bas@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Improved error messages by Michael Sebastian <msebast2@yahoo.com>
## (closes: #345620)
@DPATCH@
diff -urN videogen-0.32/args.c videogen-0.32-new/args.c
--- videogen-0.32/args.c 2006-01-02 00:28:21.000000000 -0800
+++ videogen-0.32-new/args.c 2006-01-01 23:56:35.000000000 -0800
@@ -152,6 +152,44 @@
break;
}
+ case 2:
+ case -2: {
+ pmsg (VL_DEBUG, "[cmdline] arg %u: %s has an invalid parameter \"%s\": width must be between %u and %u\n",
+ ap->aindex, (*ap->options)[ap->oindex].ao_option, (*ap->options)[ap->oindex].ao_parameter,
+ CFG_WIDTH_MIN, CFG_WIDTH_MAX);
+ pmsg (VL_NORMAL, "argument %u (%s) has an invalid parameter: width must be between %u and %u\n",
+ ap->aindex, ap->argv[ap->aindex], CFG_WIDTH_MIN, CFG_WIDTH_MAX);
+ return (-1);
+ }
+
+ case 3:
+ case -3: {
+ pmsg (VL_DEBUG, "[cmdline] arg %u: %s has an invalid parameter \"%s\": height must be between %u and %u\n",
+ ap->aindex, (*ap->options)[ap->oindex].ao_option, (*ap->options)[ap->oindex].ao_parameter,
+ CFG_HEIGHT_MIN, CFG_HEIGHT_MAX);
+ pmsg (VL_NORMAL, "argument %u (%s) has an invalid parameter: height must be between %u and %u\n",
+ ap->aindex, ap->argv[ap->aindex], CFG_HEIGHT_MIN, CFG_HEIGHT_MAX);
+ return (-1);
+ }
+
+ case 4:
+ case -4: {
+ pmsg (VL_DEBUG, "[cmdline] arg %u: %s has an invalid parameter \"%s\": aspect ratio must be between %f and %f\n",
+ ap->aindex, (*ap->options)[ap->oindex].ao_option, (*ap->options)[ap->oindex].ao_parameter,
+ CFG_ASPECT_RATIO_MIN, CFG_ASPECT_RATIO_MAX);
+ pmsg (VL_NORMAL, "argument %u (%s) has an invalid parameter: aspect ratio must be between %f and %f\n",
+ ap->aindex, ap->argv[ap->aindex], CFG_ASPECT_RATIO_MIN, CFG_ASPECT_RATIO_MAX);
+ return (-1);
+ }
+
+ case 6: {
+ pmsg (VL_DEBUG, "[cmdline] arg %u: %s has an invalid parameter \"%s\": width must be a multiple of 8\n",
+ ap->aindex, (*ap->options)[ap->oindex].ao_option, (*ap->options)[ap->oindex].ao_parameter);
+ pmsg (VL_NORMAL, "argument %u (%s) has an invalid parameter: width must be a multiple of 8\n",
+ ap->aindex, ap->argv[ap->aindex]);
+ return (-1);
+ }
+
default: {
pmsg (VL_DEBUG, "[cmdline] arg %u: %s has an invalid parameter \"%s\"\n", ap->aindex,
(*ap->options)[ap->oindex].ao_option, (*ap->options)[ap->oindex].ao_parameter);
diff -urN videogen-0.32/cfg.y videogen-0.32-new/cfg.y
--- videogen-0.32/cfg.y 2002-10-29 20:51:57.000000000 -0800
+++ videogen-0.32-new/cfg.y 2006-01-02 00:14:22.000000000 -0800
@@ -168,9 +168,44 @@
break;
}
+ case 2:
+ case -2: {
+ pmsg (VL_DEBUG, "[cfgfile] line %u: invalid parameter %lux%lu: width must be between %u and %u\n",
+ lexer_num_lines, $2, $4, CFG_WIDTH_MIN, CFG_WIDTH_MAX);
+ pmsg (VL_VERBOSE, "error at line %u: invalid parameter %lux%lu: width must be between %u and %u\n",
+ lexer_num_lines, $2, $4, CFG_WIDTH_MIN, CFG_WIDTH_MAX);
+ YYABORT;
+ }
+
+ case 3:
+ case -3: {
+ pmsg (VL_DEBUG, "[cfgfile] line %u: invalid parameter %lux%lu: height must be between %u and %u\n",
+ lexer_num_lines, $2, $4, CFG_HEIGHT_MIN, CFG_HEIGHT_MAX);
+ pmsg (VL_VERBOSE, "error at line %u: invalid parameter %lux%lu: height must be between %u and %u\n",
+ lexer_num_lines, $2, $4, CFG_HEIGHT_MIN, CFG_HEIGHT_MAX);
+ YYABORT;
+ }
+
+ case 4:
+ case -4: {
+ pmsg (VL_DEBUG, "[cfgfile] line %u: invalid parameter %lux%lu: aspect ratio must be between %f and %f\n",
+ lexer_num_lines, $2, $4, CFG_ASPECT_RATIO_MIN, CFG_ASPECT_RATIO_MAX);
+ pmsg (VL_VERBOSE, "error at line %u: invalid parameter %lux%lu: aspect ratio must be between %f and %f\n",
+ lexer_num_lines, $2, $4, CFG_ASPECT_RATIO_MIN, CFG_ASPECT_RATIO_MAX);
+ YYABORT;
+ }
+
+ case 6: {
+ pmsg (VL_DEBUG, "[cfgfile] line %u: invalid parameter %lux%lu: width must be a multiple of 8\n",
+ lexer_num_lines, $2, $4);
+ pmsg (VL_VERBOSE, "error at line %u: invalid parameter %lux%lu: width must be a multiple of 8\n",
+ lexer_num_lines, $2, $4);
+ YYABORT;
+ }
+
default: {
pmsg (VL_DEBUG, "[cfgfile] line %u: invalid parameter %lux%lu\n", lexer_num_lines, $2, $4);
- pmsg (VL_VERBOSE, "error at line %u: invalid parameter\n", lexer_num_lines);
+ pmsg (VL_VERBOSE, "error at line %u: invalid parameter %lux%lu\n", lexer_num_lines, $2, $4);
YYABORT;
}
}
|