215{
219
222
224 die(
"lfn_add_slot called with non-LFN directory entry");
225
228 int can_clear = 0;
229
230
231
232
233
234
235
236
237 printf(
"A new long file name starts within an old one.\n");
241 printf(
" It could be that the LFN start bit is wrong here\n"
242 " if \"%s\" seems to match \"%s\".\n", part1, part2);
245 can_clear = 1;
246 }
248 printf(
"1: Delete previous LFN\n2: Leave it as it is.\n");
249 if (can_clear)
250 printf(
"3: Clear start bit and concatenate LFNs\n");
251 } else
252 printf(
" Not auto-correcting this.\n");
254 switch (
get_key(can_clear ?
"123" :
"12",
"?")) {
255 case '1':
258 break;
259 case '2':
260 break;
261 case '3':
262 lfn->
id &= ~LFN_ID_START;
264 sizeof(lfn->
id), &lfn->
id);
265 break;
266 }
267 }
268 }
275
276
277
278
280 printf(
"Long filename fragment \"%s\" found outside a LFN "
281 "sequence.\n (Maybe the start bit is missing on the "
282 "last fragment)\n", part);
285 printf(
"1: Delete fragment\n2: Leave it as it is.\n"
286 "3: Set start bit\n");
287 } else
288 printf(
" Not auto-correcting this.\n");
290 case '1':
296 return;
297 case '2':
299 return;
300 case '3':
303 sizeof(lfn->
id), &lfn->
id);
309 break;
310 }
312
313
314
315
316
317 int can_fix = 0;
318 printf(
"Unexpected long filename sequence number "
323 printf(
" It could be that just the number is wrong\n"
324 " if \"%s\" seems to match \"%s\".\n", part1, part2);
327 can_fix = 1;
328 }
331 ("1: Delete LFN\n2: Leave it as it is (and ignore LFN so far)\n");
332 if (can_fix)
333 printf(
"3: Correct sequence number\n");
334 } else
335 printf(
" Not auto-correcting this.\n");
337 case '1':
341 }
345 return;
346 case '2':
348 return;
349 case '3':
352 sizeof(lfn->
id), &lfn->
id);
353 break;
354 }
355 }
356
358
359
360
361 printf(
"Checksum in long filename part wrong "
362 "(%02x vs. expected %02x).\n",
365 printf(
"1: Delete LFN\n2: Leave it as it is.\n"
366 "3: Correct checksum\n");
367 } else
368 printf(
" Not auto-correcting this.\n");
371 case '1':
375 return;
376 case '2':
377 break;
378 case '3':
382 break;
383 }
384 }
385 }
386
394 }
395
397 printf(
"Reserved field in VFAT long filename slot is not 0 "
400 printf(
"1: Fix.\n2: Leave it.\n");
401 else
402 printf(
"Auto-setting to 0.\n");
407 }
408 }
410 printf(
"Start cluster field in VFAT long filename slot is not 0 "
411 "(but 0x%04x).\n", lfn->
start);
413 printf(
"1: Fix.\n2: Leave it.\n");
414 else
415 printf(
"Auto-setting to 0.\n");
420 }
421 }
422}
#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)