207{
211
214
216 die(
"lfn_add_slot called with non-LFN directory entry");
217
220 int can_clear = 0;
221
222
223
224
225
226
227
228
229 printf(
"A new long file name starts within an old one.\n");
233 printf(
" It could be that the LFN start bit is wrong here\n"
234 " if \"%s\" seems to match \"%s\".\n", part1, part2);
237 can_clear = 1;
238 }
240 printf(
"1: Delete previous LFN\n2: Leave it as it is.\n");
241 if (can_clear)
242 printf(
"3: Clear start bit and concatenate LFNs\n");
243 } else
244 printf(
" Not auto-correcting this.\n");
246 switch (
get_key(can_clear ?
"123" :
"12",
"?")) {
247 case '1':
250 break;
251 case '2':
252 break;
253 case '3':
254 lfn->
id &= ~LFN_ID_START;
256 sizeof(lfn->
id), &lfn->
id);
257 break;
258 }
259 }
260 }
267
268
269
270
272 printf(
"Long filename fragment \"%s\" found outside a LFN "
273 "sequence.\n (Maybe the start bit is missing on the "
274 "last fragment)\n", part);
277 printf(
"1: Delete fragment\n2: Leave it as it is.\n"
278 "3: Set start bit\n");
279 } else
280 printf(
" Not auto-correcting this.\n");
282 case '1':
288 return;
289 case '2':
291 return;
292 case '3':
295 sizeof(lfn->
id), &lfn->
id);
301 break;
302 }
304
305
306
307
308
309 int can_fix = 0;
310 printf(
"Unexpected long filename sequence number "
315 printf(
" It could be that just the number is wrong\n"
316 " if \"%s\" seems to match \"%s\".\n", part1, part2);
319 can_fix = 1;
320 }
323 ("1: Delete LFN\n2: Leave it as it is (and ignore LFN so far)\n");
324 if (can_fix)
325 printf(
"3: Correct sequence number\n");
326 } else
327 printf(
" Not auto-correcting this.\n");
329 case '1':
333 }
337 return;
338 case '2':
340 return;
341 case '3':
344 sizeof(lfn->
id), &lfn->
id);
345 break;
346 }
347 }
348
350
351
352
353 printf(
"Checksum in long filename part wrong "
354 "(%02x vs. expected %02x).\n",
357 printf(
"1: Delete LFN\n2: Leave it as it is.\n"
358 "3: Correct checksum\n");
359 } else
360 printf(
" Not auto-correcting this.\n");
363 case '1':
367 return;
368 case '2':
369 break;
370 case '3':
374 break;
375 }
376 }
377 }
378
386 }
387
389 printf(
"Reserved field in VFAT long filename slot is not 0 "
392 printf(
"1: Fix.\n2: Leave it.\n");
393 else
394 printf(
"Auto-setting to 0.\n");
399 }
400 }
402 printf(
"Start cluster field in VFAT long filename slot is not 0 "
403 "(but 0x%04x).\n", lfn->
start);
405 printf(
"1: Fix.\n2: Leave it.\n");
406 else
407 printf(
"Auto-setting to 0.\n");
412 }
413 }
414}
#define CNV_PARTS_SO_FAR()
#define CNV_THIS_PART(lfn)
unsigned char lfn_checksum
static void clear_lfn_slots(int start, int end)
void lfn_check_orphaned(void)
static void copy_lfn_part(unsigned char *dst, LFN_ENT *lfn)
unsigned char * lfn_unicode
#define offsetof(TYPE, MEMBER)
char get_key(const char *valid, const char *prompt)
void fs_write(off_t pos, int size, void *data)