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