ncftp-352425.patch 829 B

1234567891011121314151617181920212223242526272829
  1. Author: Bart Martens <bart.martens@advalvas.be>
  2. Date: 2006-02-11 20:48:08 UTC
  3. Bug-Debian: https://bugs.debian.org/352425
  4. fix rmdir fails on trailing slash added by tab completion
  5. diff -ruN orig/ncftp-3.1.9/libncftp/c_rmdir.c ncftp-3.1.9/libncftp/c_rmdir.c
  6. --- orig/ncftp-3.1.9/libncftp/c_rmdir.c 2005-01-01 22:29:02.000000000 +0100
  7. +++ ncftp-3.1.9/libncftp/c_rmdir.c 2006-02-11 21:50:05.000000000 +0100
  8. @@ -15,7 +15,7 @@
  9. {
  10. FTPLineList fileList;
  11. FTPLinePtr filePtr;
  12. - char *file;
  13. + char *file, *tail;
  14. int onceResult, batchResult;
  15. if (cip == NULL)
  16. @@ -37,6 +37,9 @@
  17. cip->errNo = kErrBadLineList;
  18. break;
  19. }
  20. + tail = file + strlen( file );
  21. + while( tail > file + 1 && *(--tail) == '/' )
  22. + *tail = '\0';
  23. onceResult = FTPCmd(cip, "RMD %s", file);
  24. if (onceResult < 0) {
  25. batchResult = onceResult;