From a56309fdb6f50d4c817a89fa45964110023224c8 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 22 May 2019 17:03:52 -0400 Subject: [PATCH] Additional change to CalmaWrite: when handling cellnames with lengths exceeding the maximum GDS name length (32 characters), truncate by removing all but the last 32 characters, instead of the previous behavior which was to remove all but the first 32 characters. The last 32 characters are far more likely to be unique than the first 32, given that the usual reason for extra- long names is the concatentation of hierarchical names. --- calma/CalmaWrite.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/calma/CalmaWrite.c b/calma/CalmaWrite.c index 7879ecb1..44e0d6d9 100644 --- a/calma/CalmaWrite.c +++ b/calma/CalmaWrite.c @@ -2757,16 +2757,17 @@ calmaOutStringRecord(type, str, f) /* * Make sure length is even. * Output at most CALMANAMELENGTH characters. + * If the name is longer than CALMANAMELENGTH, then output the + * last CALMANAMELENGTH characters (since cell names are more + * likely to be unique in the last characters than in the first + * characters). */ if (len & 01) len++; if (len > CALMANAMELENGTH) { - char csav; TxError("Warning: Cellname %s truncated ", str); - csav = *(str + 32); - *(str + 32) = '\0'; - TxError("to %32s (GDS format limit)\n", str); - *(str + 32) = csav; + TxError("to %s (GDS format limit)\n", str + len - CALMANAMELENGTH); + locstr = str + len - CALMANAMELENGTH; len = CALMANAMELENGTH; } calmaOutI2(len+4, f); /* Record length */