diff --git a/src/apps/diskprobe/DataEditor.cpp b/src/apps/diskprobe/DataEditor.cpp index 4c2c51eee8..eccb796ada 100644 --- a/src/apps/diskprobe/DataEditor.cpp +++ b/src/apps/diskprobe/DataEditor.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -290,6 +290,19 @@ ReplaceChange::Merge(DataChange *_change) if (change == NULL) return false; + if (change->fOffset + change->fSize == fOffset + fSize && change->fSize == 1) { + // this is a special case - the new change changed the last byte of + // the old change: we do this since the same byte is changed twice + // in hex mode editing. + fNewData[fSize - 1] = change->fNewData[0]; +#ifdef TRACE_DATA_EDITOR + printf("Merge one byte %p (offset = %Ld, size = %lu):\n", this, fOffset, fSize); + dump_block(fOldData, fSize, "old:"); + dump_block(fNewData, fSize, "new:"); +#endif + return true; + } + // are the changes adjacent? if (change->fOffset + change->fSize != fOffset @@ -721,9 +734,6 @@ DataEditor::Save() void DataEditor::RemoveRedos() { - if (fLastChange == NULL) - return; - int32 start = fChanges.IndexOf(fLastChange) + 1; for (int32 i = fChanges.CountItems(); i-- > start; ) { diff --git a/src/apps/diskprobe/DiskProbe.cpp b/src/apps/diskprobe/DiskProbe.cpp index 6bd933f2f1..8a1c5ffe60 100644 --- a/src/apps/diskprobe/DiskProbe.cpp +++ b/src/apps/diskprobe/DiskProbe.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -452,7 +452,7 @@ DiskProbe::AboutRequested() { BAlert *alert = new BAlert("about", "DiskProbe\n" "\twritten by Axel Dörfler\n" - "\tCopyright 2004, Haiku.\n\n" + "\tCopyright 2004-2005, Haiku.\n\n" "original Be version by Robert Polic\n", "Ok"); BTextView *view = alert->TextView(); BFont font;