]> Trent Huber's Code - cbs.git/commitdiff
Update README.md and simplify addext()
authorTrent Huber <trentmhuber@gmail.com>
Tue, 11 Feb 2025 14:28:37 +0000 (09:28 -0500)
committerTrent Huber <trentmhuber@gmail.com>
Tue, 11 Feb 2025 14:28:37 +0000 (09:28 -0500)
README.md
cbs.c

index 6f4362add891ef291b14b277dce5d586da48df34..939a52339b4a6209a031214a8d6e8559393f4c0c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -58,7 +58,9 @@ These are macros used by the library and it expects them to exist. Any flags you
 #define LDFLAGS "-lm", "-Llib/"
 ```
 
-These will be automatically used in all compilations and linkages performed by the build file they're defined in.
+If you ever want to convert a comma separated list of strings to an array of C strings, the simple `CARRAY` macro does so.
+
+The `CFLAGS` and `LDFLAGS` macros will automatically be used in all compilations and linkages performed by the build file they're defined in.
 
 ### Compiling: `cc()`
 
diff --git a/cbs.c b/cbs.c
index aeab82a3f2277a4d25bbd1ebe32b44f4e0dfa36f..92f1a3f99171a75281d689201beab90c1bd56a7f 100644 (file)
--- a/cbs.c
+++ b/cbs.c
@@ -31,8 +31,7 @@ char *addext(char *pp, char *ext) {
    bp = rindex(pp, '/');
    bp = bp ? bp + 1 : pp;
    d = bp - pp;
-   ep = rindex(pp, '.');
-   if (ep < bp) ep = NULL;
+   ep = rindex(bp, '.');
    b = ep ? ep - bp : strlen(bp);
    ep = ep ? ep + 1 : ext;
    l = strncmp(bp, "lib", 3) != 0