0002-Fix-indentation-of-fix-power-loss-damage-commit.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. From 45aeed0c658cc86e93ae3ae101404e12bec6e102 Mon Sep 17 00:00:00 2001
  2. From: Andreas Bombe <aeb@debian.org>
  3. Date: Sun, 16 Nov 2014 19:49:22 +0100
  4. Subject: [PATCH 02/14] Fix indentation of "fix power loss damage" commit
  5. I fixed the (sometimes misleading) indentation of the code introduced in
  6. commit 6893c45 to be in line with the reset of the code and also removed
  7. the /* PATCH ED+DL */ comments which are quite meaningless to the wider
  8. world.
  9. Signed-off-by: Andreas Bombe <aeb@debian.org>
  10. ---
  11. src/check.c | 57 ++++++++++++++++++++++++---------------------------------
  12. 1 file changed, 24 insertions(+), 33 deletions(-)
  13. diff --git a/src/check.c b/src/check.c
  14. index e8aaf92..daa6d69 100644
  15. --- a/src/check.c
  16. +++ b/src/check.c
  17. @@ -273,11 +273,10 @@ static int bad_name(DOS_FILE * file)
  18. strncmp((const char *)name, "WP ROOT SF", 11) == 0)
  19. return 0;
  20. - /* PATCH ED+DL */
  21. - /* check if we have neither a long filename nor a short name */
  22. - if ((file->lfn == NULL) && (file->dir_ent.lcase & FAT_NO_83NAME)) {
  23. - return 1;
  24. - }
  25. + /* check if we have neither a long filename nor a short name */
  26. + if ((file->lfn == NULL) && (file->dir_ent.lcase & FAT_NO_83NAME)) {
  27. + return 1;
  28. + }
  29. /* don't complain about the dummy 11 bytes used by patched Linux
  30. kernels */
  31. @@ -401,20 +400,16 @@ static void auto_rename(DOS_FILE * file)
  32. (const char *)file->dir_ent.name, MSDOS_NAME))
  33. break;
  34. if (!walk) {
  35. - /* PATCH ED+DL */
  36. - if(file->dir_ent.lcase & FAT_NO_83NAME)
  37. - {
  38. - /* as we only assign a new 8.3 filename, reset flag that 8.3 name is not
  39. - present */
  40. - file->dir_ent.lcase &= ~FAT_NO_83NAME;
  41. - /* reset the attributes */
  42. - file->dir_ent.attr &= ~(ATTR_DIR | ATTR_VOLUME); /* only keep the DIR and VOLUME attributes */
  43. - fs_write(file->offset, MSDOS_NAME+2, file->dir_ent.name);
  44. - }
  45. - else
  46. - {
  47. - fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
  48. - }
  49. + if (file->dir_ent.lcase & FAT_NO_83NAME) {
  50. + /* as we only assign a new 8.3 filename, reset flag that 8.3 name is not
  51. + present */
  52. + file->dir_ent.lcase &= ~FAT_NO_83NAME;
  53. + /* reset the attributes, only keep DIR and VOLUME */
  54. + file->dir_ent.attr &= ~(ATTR_DIR | ATTR_VOLUME);
  55. + fs_write(file->offset, MSDOS_NAME + 2, file->dir_ent.name);
  56. + } else {
  57. + fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
  58. + }
  59. if (file->lfn)
  60. lfn_fix_checksum(file->lfn_offset, file->offset,
  61. (const char *)file->dir_ent.name);
  62. @@ -448,20 +443,16 @@ static void rename_file(DOS_FILE * file)
  63. walk[1] = 0;
  64. for (walk = name; *walk == ' ' || *walk == '\t'; walk++) ;
  65. if (file_cvt(walk, file->dir_ent.name)) {
  66. - /* PATCH ED+DL */
  67. - if(file->dir_ent.lcase & FAT_NO_83NAME)
  68. - {
  69. - /* as we only assign a new 8.3 filename, reset flag that 8.3 name is not
  70. - present */
  71. - file->dir_ent.lcase &= ~FAT_NO_83NAME;
  72. - /* reset the attributes */
  73. - file->dir_ent.attr &= ~(ATTR_DIR | ATTR_VOLUME); /* only keep the DIR and VOLUME attributes */
  74. - fs_write(file->offset, MSDOS_NAME+2, file->dir_ent.name);
  75. - }
  76. - else
  77. - {
  78. - fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
  79. - }
  80. + if (file->dir_ent.lcase & FAT_NO_83NAME) {
  81. + /* as we only assign a new 8.3 filename, reset flag that 8.3 name is not
  82. + present */
  83. + file->dir_ent.lcase &= ~FAT_NO_83NAME;
  84. + /* reset the attributes, only keep DIR and VOLUME */
  85. + file->dir_ent.attr &= ~(ATTR_DIR | ATTR_VOLUME);
  86. + fs_write(file->offset, MSDOS_NAME + 2, file->dir_ent.name);
  87. + } else {
  88. + fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
  89. + }
  90. if (file->lfn)
  91. lfn_fix_checksum(file->lfn_offset, file->offset,
  92. (const char *)file->dir_ent.name);
  93. --
  94. 1.9.1