Linha de comando: pasta é ignorada com aviso, projeto é aberto
Todo argumento ia para o dlopen como library: abrir o editor com uma pasta (./TinyBlocks.AppDir) dava "dlopen: ... Is a directory". Agora .so é library, pasta é ignorada com um aviso claro e qualquer outro arquivo é aberto como projeto (.json, ou .txt em scratchblocks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2a2d22a64a
commit
bfa17eecea
15 files changed
+9784
-124
No files matched your search
@@ -57,7 +57,7 @@ static Tab* arg_block_tab(Ed* ed, TbMcpRequest* rq, int* idx) {
|
||||
return &ed->tabs[t];
|
||||
}
|
||||
|
||||
static bool block_ok(Tab* T, int bi) { return bi >= 0 && bi < MAX_WS && T->ws[bi].used; }
|
||||
static bool block_ok(Tab* T, int bi) { return bi >= 0 && bi < T->ws_n && T->ws[bi].used; }
|
||||
|
||||
static int arg_block(TbMcpRequest* rq, Tab* T, const char* key) {
|
||||
if (!tb_mcp_req_has(rq, key)) { tb_mcp_req_error(rq, "Falta o argumento \"%s\"", key); return -1; }
|
||||
@@ -317,8 +317,8 @@ static void t_list_stacks(void* user, TbMcpRequest* rq) {
|
||||
Tab* T = arg_block_tab(ed, rq, &ti);
|
||||
if (!T) return;
|
||||
layout_tab(T);
|
||||
int order[MAX_WS];
|
||||
int n = stacks_sorted(T, order);
|
||||
int* order = T->top_n > 0 ? (int*)malloc((size_t)T->top_n * sizeof(int)) : NULL;
|
||||
int n = order ? stacks_sorted(T, order) : 0;
|
||||
char* text = NULL;
|
||||
size_t len = 0, cap = 0;
|
||||
text_add(&text, &len, &cap, "Aba %d \"%s\": %d pilha(s)\n\n", ti, T->name, n);
|
||||
@@ -326,6 +326,7 @@ static void t_list_stacks(void* user, TbMcpRequest* rq) {
|
||||
for (int i = 0; i < n; i++) jpush(arr, stack_json(ed, T, order[i], &text, &len, &cap));
|
||||
tb_mcp_req_text(rq, "%s", text ? text : "");
|
||||
free(text);
|
||||
free(order);
|
||||
TinyBlocks_JsonValue* o = tb_json_object();
|
||||
jset(o, "tab", tb_json_number(ti));
|
||||
jset(o, "stacks", arr);
|
||||
|
||||
Reference in new issue
Block a user