Sunday, November 30, 2025
Semantic versioning is hard; let’s go build a rocket
Wow! I found another bug from the depths of time in [mod\_blog](https://github.com/spc476/mod_blog), or rather, CGILib, which mod_blog uses. And again, this goes back right when I first wrote the code, possibly back in the late 1990s. And again, it’s amazing that it took me this long (less than an hour ago) to trigger it!
When I made my previous post, the title came out incorrectly as “Error ID10T” when it should have been “Error ID10T: PEBKAC”. Somehow, any text after the colon was being swal…
Sunday, November 30, 2025
Semantic versioning is hard; let’s go build a rocket
Wow! I found another bug from the depths of time in [mod\_blog](https://github.com/spc476/mod_blog), or rather, CGILib, which mod_blog uses. And again, this goes back right when I first wrote the code, possibly back in the late 1990s. And again, it’s amazing that it took me this long (less than an hour ago) to trigger it!
When I made my previous post, the title came out incorrectly as “Error ID10T” when it should have been “Error ID10T: PEBKAC”. Somehow, any text after the colon was being swallowed up somewhere. It didn’t take long to find the culpret in the function [PairNew\(\)](https://github.com/spc476/CGILib/blob/814cd23de1e6e33d7cc148913833f0175925c33a/src/Pair/PairNew.c#L74) and this bit of code:
src = *psrc;
p = todelim(src,&sname,delim,eos);
name = malloc(sname + 1);
if (name == NULL)
return NULL;
memcpy(name,src,sname);
name[sname] = '\0';
if (*p == delim)
{
src = p + 1;
p = todelim(src,&svalue,delim,eos); // WRONG!
}
else
svalue = 0;
This function is used to parse a header line like Title: Error ID10T: PEBKAC and turn it into two values, TITLE and Error ID10T: PEBKAC. It’s the line labeled “wrong” that points to the problem—I was checking for another occurance of delim (in this case, it’s a colon) and ignoring anything past that when it shouldn’t.
Sigh.
Like most bugs, the fix is easy, but what I do next is difficult. I (try to) use semantic versioning for CGILib, although there are two issues here—one, this is a bug so obviously the fixed version should be 8.0.8, but on the other hand, this introduces an incompatible change so the next version should be 9.0.0. On the gripping hand, it changes what I consider incorrect behavior and aligns the function to better reflect its name, so maybe version 8.0.8?
I think for CGILib this is largely academic, as I don’t think anyone really uses the library except me. I shall have to think on this one.
You have my permission to link freely to any entry here. Go ahead, I won’t bite. I promise.
The dates are the permanent links to that day’s entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:
https://boston.conman.org/2000/08/01
You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.
You may also note subtle shading of the links and that’s intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It’s an experiment in using color shading to denote the distance a link is from here. If you don’t notice it, don’t worry; it’s not all that important.
It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.