Index: libcfa/src/containers/string_res.cfa
===================================================================
--- libcfa/src/containers/string_res.cfa	(revision fe18b46d7a80d743842002e3565a3f0e9fc6a0a4)
+++ libcfa/src/containers/string_res.cfa	(revision 0ca15b74a1af1d7ecea0babdf66b02787cff7715)
@@ -405,6 +405,6 @@
 
     verify( shareEditSetEndPeer->Handle.s >= shareEditSetStartPeer->Handle.s );
-    size_t editSetLength = shareEditSetEndPeer->Handle.s + shareEditSetEndPeer->Handle.lnth - shareEditSetStartPeer->Handle.s;
-    verify( editSetLength >= this.Handle.lnth );
+    size_t origEditSetLength = shareEditSetEndPeer->Handle.s + shareEditSetEndPeer->Handle.lnth - shareEditSetStartPeer->Handle.s;
+    verify( origEditSetLength >= this.Handle.lnth );
 
     if ( this.shareEditSet_owns_ulink ) {                 // assigning to private context
@@ -418,5 +418,5 @@
         if ( char * oldBytes = VbyteTryAdjustLast( *this.Handle.ulink, delta ) ) {
             // growing: copy from old to new
-            char * dest = VbyteAlloc( *this.Handle.ulink, editSetLength );
+            char * dest = VbyteAlloc( *this.Handle.ulink, origEditSetLength + delta );
             char *destCursor = dest;  memcpy(destCursor, prefixStartOrig, prefixLen);
             destCursor += prefixLen;  memcpy(destCursor, buffer         , bsize    );
@@ -424,5 +424,5 @@
             assignEditSet(this, shareEditSetStartPeer, shareEditSetEndPeer, 
                 dest,
-                editSetLength,
+                origEditSetLength + delta,
                 0p, bsize);
             free( oldBytes );
@@ -434,10 +434,10 @@
             assignEditSet(this, shareEditSetStartPeer, shareEditSetEndPeer, 
                 shareEditSetStartPeer->Handle.s,
-                editSetLength,
+                origEditSetLength + delta,
                 0p, bsize);
         }
 
     } else if (                                           // assigning to shared context
-        this.Handle.lnth == editSetLength &&              // overwriting entire run of SES
+        this.Handle.lnth == origEditSetLength &&          // overwriting entire run of SES
         & valSrc &&                                       // sourcing from a managed string
         valSrc.Handle.ulink == this.Handle.ulink  ) {     // sourcing from same heap
Index: tests/collections/.expect/string-overwrite-noshare.txt
===================================================================
--- tests/collections/.expect/string-overwrite-noshare.txt	(revision 0ca15b74a1af1d7ecea0babdf66b02787cff7715)
+++ tests/collections/.expect/string-overwrite-noshare.txt	(revision 0ca15b74a1af1d7ecea0babdf66b02787cff7715)
@@ -0,0 +1,1 @@
+string-overwrite.txt
Index: tests/collections/string-overwrite-noshare.cfa
===================================================================
--- tests/collections/string-overwrite-noshare.cfa	(revision 0ca15b74a1af1d7ecea0babdf66b02787cff7715)
+++ tests/collections/string-overwrite-noshare.cfa	(revision 0ca15b74a1af1d7ecea0babdf66b02787cff7715)
@@ -0,0 +1,2 @@
+#define STRING_SHARING_OFF
+#include "string-overwrite.cfa"
Index: tests/collections/string-overwrite.cfa
===================================================================
--- tests/collections/string-overwrite.cfa	(revision fe18b46d7a80d743842002e3565a3f0e9fc6a0a4)
+++ tests/collections/string-overwrite.cfa	(revision 0ca15b74a1af1d7ecea0babdf66b02787cff7715)
@@ -1,3 +1,4 @@
 #include <containers/string.hfa>
+#include <string_sharectx.hfa>
 
 /*
@@ -11,5 +12,5 @@
 WE = witness end
 
-The dest does:
+The test does:
   starts with the entire string being, initially, the alphabet; prints this entire alphabet
   sets up modifier and witness as ranges within it, and prints a visualization of those ranges
@@ -24,4 +25,5 @@
 This API's convention has Start positions being inclusive and end positions being exclusive.
 
+                                v Case number in output
 With 1 equivalence class:
 MS = ME = WS = WE               1
@@ -118,5 +120,4 @@
     struct { int ms; int me; int ws; int we; char *replaceWith; char *label; } cases[] = {
         { 12, 14, 10, 20, "xxxxx", "warmup" },
-//        { 12, 14, 12, 14, "xxxxx", ""       },  // the bug that got me into this test (should be a dup with case 6)
         { 10, 10, 10, 10, "=====", "1"      },
         { 10, 10, 10, 10, "=="   , ""       },
@@ -223,10 +224,4 @@
         { 12, 14, 10, 16, "="    , ""       },
         { 12, 14, 10, 16, ""     , ""       },
-/*
-        { , , , , "=====", "NN"     },
-        {  "=="   , ""       },
-        {  "="    , ""       },
-        {  ""     , ""       },
-*/
     };
     for ( i; sizeof(cases)/sizeof(cases[0]) ) {
@@ -238,13 +233,11 @@
 
 
-// void f( string & s, string & toEdit ) {
-
-//     sout | s | "|" | toEdit | "|";
-
-//     s(14, 16) = "-";
-//     sout | s | "|" | toEdit | "|";
-// }
-
 int main() {
+
+    #ifdef STRING_SHARING_OFF
+    string_sharectx c = { NO_SHARING };
+    #endif
+
+
     //          0         1         2
     //          01234567890123456789012345
