In article <[EMAIL PROTECTED]> Jun Kuriyama <[EMAIL PROTECTED]> writes:
> When entering fdisk editor after booting from CD-ROM, I cannot delete > NTFS partition by "D" key. "D" key only shows cursor up (NTFS is at > offset 63, offset 0 seems boot selector for NT). > > Can I do something for debugging? I think this patch solves the problem. --- TAKAHASHI Yoshihiro <[EMAIL PROTECTED]>
Index: chunk.c =================================================================== RCS file: /home/ncvs/src/lib/libdisk/chunk.c,v retrieving revision 1.45 diff -u -r1.45 chunk.c --- chunk.c 15 Nov 2002 13:24:29 -0000 1.45 +++ chunk.c 20 Nov 2002 04:57:30 -0000 @@ -416,24 +416,27 @@ int Delete_Chunk2(struct disk *d, struct chunk *c, int rflags) { - struct chunk *c1 = 0, *c2, *c3; + struct chunk *c1, *c2, *c3; chunk_e type = c->type; u_long offset = c->offset; - if(type == whole) + switch (type) { + case whole: + case unused: return 1; -#ifndef PC98 - if (!c1 && (type == freebsd || type == fat || type == unknown)) - c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, extended); -#endif - if (!c1 && (type == freebsd || type == fat || type == unknown)) - c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, whole); -#ifndef PC98 - if (!c1 && type == extended) + case extended: c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, whole); -#endif - if (!c1 && type == part) + break; + case part: c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, freebsd); + break; + default: + c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, extended); + if (!c1) + c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, + whole); + break; + } if (!c1) return 1; for (c2 = c1->part; c2; c2 = c2->next) {