Skip to content

Commit

Permalink
fix last-index-of1 and std/os/path/extname
Browse files Browse the repository at this point in the history
  • Loading branch information
daanx committed May 31, 2021
1 parent a4b7e39 commit 11d813c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kklib/include/kklib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef KKLIB_H
#define KKLIB_H

#define KKLIB_BUILD 28 // modify on changes to trigger recompilation
#define KKLIB_BUILD 29 // modify on changes to trigger recompilation
#define KK_MULTI_THREADED 1 // set to 0 to be used single threaded only
// #define KK_DEBUG_FULL 1

Expand Down
2 changes: 1 addition & 1 deletion kklib/src/bytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ kk_ssize_t kk_bytes_last_index_of1(kk_bytes_t b, kk_bytes_t sub, kk_context_t* c
else if (tlen > slen) {
idx = 0;
}
else if (tlen <= slen) {
else if (tlen == slen) {
idx = (kk_bytes_cmp_borrow(b, sub) == 0 ? 1 : 0);
}
else {
Expand Down
9 changes: 5 additions & 4 deletions util/bundle.kk
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,14 @@ fun copy-kklib( variant : variant, libdir : path, cc : string, version : string
val vardir = cc ++ "-" ++ variant.show
val objdir = libdir / vardir
val outdir = "out" / version / vardir
val kklib = // if (get-os-name()=="windows") then "kklib.lib" else "libkklib.a"
if (get-os-name()=="windows") then "kklib.obj" else "kklib.o"
ensure-dir(objdir)
copy-file-to-dir( outdir / kklib, objdir )
val all = list-directory(outdir)
val files = all.filter(fn(f){ !is-directory(f) })
val objs = files.filter(fn(f){ f.basename.starts-with("std_").bool && f.extname != "core" })
val objs = files.filter(fn(f){
val ext = f.extname
((f.basename.starts-with("std_").bool && ext != "core")
|| ext == "a" || ext == "lib" || ext == "o" || ext == "obj")
})
objs.foreach fn(obj){
// println("copy " ++ obj.string)
copy-file-to-dir( obj, objdir )
Expand Down

0 comments on commit 11d813c

Please sign in to comment.