sfdisk.010.index-rindex-fix.patch 620 B

123456789101112131415161718192021
  1. diff -ru sfdisk_llseek-fix/sfdisk.c sfdisk_index-rindex-fix/sfdisk.c
  2. --- sfdisk_llseek-fix/sfdisk.c 2008-04-17 08:42:35.000000000 +0000
  3. +++ sfdisk_index-rindex-fix/sfdisk.c 2008-04-17 09:50:17.000000000 +0000
  4. @@ -58,6 +58,17 @@
  5. #define SIZE(a) (sizeof(a)/sizeof(a[0]))
  6. +/*
  7. + * Why these wouldn't be defined in string.h, I don't know, there is a block
  8. + * testing for BSD, and no other mention of these functions ... NK
  9. + */
  10. +#if !defined(index)
  11. +# define index(s,c) strchr((s), (c))
  12. +#endif
  13. +#if !defined(rindex)
  14. +# define rindex(s,c) strrchr((s), (c))
  15. +#endif
  16. +
  17. /*
  18. * Table of contents:
  19. * A. About seeking