mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
5.2 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/jimmy/ne/cancel-number.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. --- ./src/actions.c.orig 2001-09-01 00:32:32.000000000 +0300
  23. +++ ./src/actions.c 2003-02-02 15:39:29.000000000 +0200
  24. @@ -44,6 +44,12 @@
  25. }
  26. +/* This macro converts a non-positive result from request_number() to OK if the
  27. +function was aborted or not-a-number error if an invalid number was read. */
  28. +
  29. +#define NUMERIC_ERROR(c) ((c) == ABORT ? OK : NOT_A_NUMBER)
  30. +
  31. +
  32. /* This is the vector table through which all actions which have some effect
  33. @@ -218,13 +224,13 @@
  34. return(BOOKMARK_OUT_OF_RANGE);
  35. case GOTOLINE_A:
  36. - if (c<0 && (c = request_number("Line", b->cur_line+1))<0) return NOT_A_NUMBER;
  37. + if (c<0 && (c = request_number("Line", b->cur_line+1))<0) return NUMERIC_ERROR(c);
  38. if (c == 0 || c>b->line_num) c = b->line_num;
  39. goto_line(b, --c);
  40. return(OK);
  41. case GOTOCOLUMN_A:
  42. - if (c<0 && (c = request_number("Column", b->cur_x+b->win_x+1))<0) return NOT_A_NUMBER;
  43. + if (c<0 && (c = request_number("Column", b->cur_x+b->win_x+1))<0) return NUMERIC_ERROR(c);
  44. goto_column(b, c ? --c : 0);
  45. return(OK);
  46. @@ -253,7 +259,7 @@
  47. static int last_ic = 32;
  48. if (b->opt.read_only) return(FILE_IS_READ_ONLY);
  49. - if (c<0 && (c = request_number("Char Code", last_ic))<0) return NOT_A_NUMBER;
  50. + if (c<0 && (c = request_number("Char Code", last_ic))<0) return NUMERIC_ERROR(c);
  51. if (c == 0) return(CANT_INSERT_0);
  52. if (c > 255) return(ERROR);
  53. last_ic = c;
  54. @@ -604,7 +610,7 @@
  55. return(OK);
  56. case ESCAPETIME_A:
  57. - if (c<0 && (c = request_number("Timeout (1/10s)", -1))<0) return NOT_A_NUMBER;
  58. + if (c<0 && (c = request_number("Timeout (1/10s)", -1))<0) return NUMERIC_ERROR(c);
  59. if (c < 256) {
  60. set_escape_time(c);
  61. return(OK);
  62. @@ -612,7 +618,7 @@
  63. else return(ESCAPE_TIME_OUT_OF_RANGE);
  64. case TABSIZE_A:
  65. - if (c<0 && (c = request_number("TAB Size", b->opt.tab_size))<=0) return NOT_A_NUMBER;
  66. + if (c<0 && (c = request_number("TAB Size", b->opt.tab_size))<=0) return NUMERIC_ERROR(c);
  67. if (c<ne_columns/2) {
  68. move_to_sol(b);
  69. b->opt.tab_size = c;
  70. @@ -622,17 +628,17 @@
  71. return(TAB_SIZE_OUT_OF_RANGE);
  72. case TURBO_A:
  73. - if (c<0 && (c = request_number("Turbo Threshold", turbo))<0) return NOT_A_NUMBER;
  74. + if (c<0 && (c = request_number("Turbo Threshold", turbo))<0) return NUMERIC_ERROR(c);
  75. turbo = c;
  76. return(OK);
  77. case CLIPNUMBER_A:
  78. - if (c<0 && (c = request_number("Clip Number", b->opt.cur_clip))<0) return NOT_A_NUMBER;
  79. + if (c<0 && (c = request_number("Clip Number", b->opt.cur_clip))<0) return NUMERIC_ERROR(c);
  80. b->opt.cur_clip = c;
  81. return(OK);
  82. case RIGHTMARGIN_A:
  83. - if (c<0 && (c = request_number("Right Margin", b->opt.right_margin))<0) return NOT_A_NUMBER;
  84. + if (c<0 && (c = request_number("Right Margin", b->opt.right_margin))<0) return NUMERIC_ERROR(c);
  85. b->opt.right_margin = c;
  86. return(OK);
  87. @@ -722,7 +728,7 @@
  88. case PLAY_A:
  89. if (!b->recording && !b->executing_internal_macro) {
  90. - if (c<0 && (c = request_number("Times", 1))<=0) return NOT_A_NUMBER;
  91. + if (c<0 && (c = request_number("Times", 1))<=0) return NUMERIC_ERROR(c);
  92. b->executing_internal_macro = 1;
  93. for(i=0; i<c && !(error = play_macro(b, b->cur_macro)); i++);
  94. b->executing_internal_macro = 0;
  95. --- ./src/errors.h.orig 2001-09-01 00:32:32.000000000 +0300
  96. +++ ./src/errors.h 2003-02-02 15:39:29.000000000 +0200
  97. @@ -37,6 +37,11 @@
  98. #undef ERROR
  99. #endif
  100. +#ifdef ABORT
  101. +#undef ABORT
  102. +#endif
  103. +
  104. +#define ABORT (-2)
  105. #define ERROR (-1)
  106. #define OK (0)
  107. --- ./src/input.c.orig 2001-09-01 00:32:32.000000000 +0300
  108. +++ ./src/input.c 2003-02-02 15:39:29.000000000 +0200
  109. @@ -126,7 +126,8 @@
  110. if (default_value >= 0) sprintf(t, "%d", default_value);
  111. - if (!(result = request(prompt, default_value >= 0 ? t : NULL, FALSE, 0)) || !*result) return(ERROR);
  112. + if (!(result = request(prompt, default_value >= 0 ? t : NULL, FALSE, 0))) return(ABORT);
  113. + if (!*result) return(ERROR);
  114. n = strtol(result, &p, 0);
  115. --- ./src/menu.c.orig 2001-09-01 00:32:32.000000000 +0300
  116. +++ ./src/menu.c 2003-02-02 15:39:29.000000000 +0200
  117. @@ -510,7 +510,7 @@
  118. static void do_menu_action(void) {
  119. undraw_last_menu();
  120. - execute_command_line(cur_buffer, menus[current_menu].items[menus[current_menu].cur_item].command_line);
  121. + print_error(execute_command_line(cur_buffer, menus[current_menu].items[menus[current_menu].cur_item].command_line));
  122. }