patch-mmv_c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. $OpenBSD: patch-mmv_c,v 1.2 2017/04/30 13:55:57 naddy Exp $
  2. --- mmv.c.orig
  3. +++ mmv.c
  4. @@ -88,7 +88,6 @@ on the command line.\n";
  5. #endif
  6. #include <stdio.h>
  7. -#include <ctype.h>
  8. #ifdef MSDOS
  9. /* for MS-DOS (under Turbo C 1.5)*/
  10. @@ -121,14 +120,14 @@ extern unsigned _stklen = 10000;
  11. #else
  12. /* for various flavors of UN*X */
  13. +#include <string.h>
  14. #include <sys/types.h>
  15. #include <sys/stat.h>
  16. #include <sys/file.h>
  17. +#include <ctype.h>
  18. +#include <stdlib.h>
  19. +#include <unistd.h>
  20. -extern char *getenv();
  21. -extern long lseek();
  22. -extern char *malloc();
  23. -
  24. #ifdef DIRENT
  25. #include <dirent.h>
  26. typedef struct dirent DIRENTRY;
  27. @@ -142,8 +141,6 @@ typedef struct dirent DIRENTRY;
  28. typedef struct direct DIRENTRY;
  29. #endif
  30. -#define void char /* might want to remove this line */
  31. -
  32. #ifndef O_BINARY
  33. #define O_BINARY 0
  34. #endif
  35. @@ -176,7 +173,6 @@ extern char *strcpy(), *strchr();
  36. #else
  37. /* for System V and BSD */
  38. -#include <string.h>
  39. #include <sys/signal.h>
  40. #include <fcntl.h>
  41. #endif
  42. @@ -370,7 +366,7 @@ static int movealias(/* REP *first, REP *p, int *pprin
  43. static int snap(/* REP *first, REP *p */);
  44. static void showdone(/* REP *fin */);
  45. static void breakout(/* */);
  46. -static int breakrep(/* */);
  47. +static void breakrep(/* */);
  48. static void breakstat(/* */);
  49. static void quit(/* */);
  50. static int copymove(/* REP *p */);
  51. @@ -389,7 +385,6 @@ static void cleanup(/* */);
  52. static int getstat(/* char *full, FILEINFO *f */);
  53. static int dwritable(/* HANDLE *h */);
  54. static int fwritable(/* char *hname, FILEINFO *f */);
  55. -static void memmove(/* void *to, void *from, int k */);
  56. #endif
  57. #ifndef RENAME
  58. static int rename(/* char *from, char *to */);
  59. @@ -2550,10 +2545,9 @@ static void breakout()
  60. }
  61. -static int breakrep()
  62. +static void breakrep()
  63. {
  64. gotsig = 1;
  65. - return(1);
  66. }
  67. @@ -2745,7 +2739,7 @@ static int getreply(m, failact)
  68. static FILE *tty = NULL;
  69. int c, r;
  70. - fprintf(stderr, m);
  71. + fprintf(stderr, "%s", m);
  72. if (tty == NULL && (tty = fopen(TTY, "r")) == NULL) {
  73. fprintf(stderr, "Can not open %s to get reply.\n", TTY);
  74. if (failact == -1)
  75. @@ -2832,7 +2826,7 @@ static void chgive(p, k)
  76. }
  77. -#ifndef MSDOS
  78. +#if 0
  79. static void memmove(to, from, k)
  80. char *to, *from;
  81. unsigned k;