From 7a6a94e9d25b4c4da0e133751b5a9bc9fb687311 Mon Sep 17 00:00:00 2001 From: Igor Cananea Date: Mon, 13 Nov 2023 10:34:04 -0500 Subject: [PATCH] Default to aed.txt if no file name is provided. (#2) --- bin/aed.bin | Bin 21265 -> 21271 bytes src/text_buffer.c | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/aed.bin b/bin/aed.bin index 8a742c2ca197c3ce894a47c2b6ec2f4de6cf6208..3c02abbfc24ea0327db6da7b418317369c0634f9 100644 GIT binary patch delta 1335 zcmZuwYfKzf6rQudz;O_IS}2c}R-uoyP{dNK zNt2prtH(rtl%|G={;82{4Uxn~Y*tcrY>DBA+Dkg>_@nG1jR;|r0q+bXKGI}zbI&*D zeD}NOeE01Ucy9zQHyg$i8~p{fi(crGX}Y$vLkEKnynh9vga9;;5P)ETXY zJ3u}cOC}WAYa$a9G<#_DgR~g%<3vmnNcxIj#w4Z4LqO;NPrJ>wT8Tgu$BEBNe)jSWh~rE-CDRqqfWCb zulg}PD-lBI$?AXn?q1g9f(30LiuOLF&N)?Xz*|{m(17ObI`HCw>@9g$8OOKJWj6ko zCR9zPrl?)h$HS}g$x@PBq{=Zkn*A)C#Xqz6uXE2C+_TjAi_YDWqjQhsl$)50`J5gm z<8bbE3nQcMh@uz*7txVdm%Qp{(9$}zy~2>-qXj(PDcgj@dEIaq6I>2P=5hI~4b|)# z&Tww>XVm#nl~3bauB~tygRblL#42)3C;Fdyyy)JoYq;YshD#Wmk9u$=e;i)NeFY9Z z=r4E|oB=iZg^SC<=~>cJvooU>=(bKhhcF zipK3LK0@tgWlUgZ%iO&-mT5VJKNeLPcddwPX(e*(X=JjSzgtY za7HSVJ5B8o_C|sN^A&RrPwh)MRqk*vvwNj!)AEDOgyphi!`;*y`9|>(Etc5W>k6_V z)Px3sL=<%RYQcg%zC)%JUtq@91y;kV!ebn_W~d%)s^}D0yA-{YouoMv!p?O9rYJI7 zK~(uF{#MbL;x!!VSYT8Mh5n&4%>{b_;cqS>w3%Ta0kf^4|du;fC9Ljcw(E?Sl6 ztH_$UBH@n68Wh6&eh2NllAM1^EdYx_b9=h+aeo6M C*Em@K delta 1331 zcmZuwYfKbZ6rRIlmg!Yko(rKZ%o1H#U>61!s10aQQWh3rkcyBhmWLuLw6+ll7HQKa znlz^5nA9IOJ{oENm`c`$)}$uXYz;Oe!DN3l@sf^Y`lC9VYN^(3ru5E0(nm}tH}`z^ zoNvB+&UZhVg2^fPxU2S%Oq8QMQK>j26RIfygy%xa^2JqwfXCkcLx{w$~d?Z%pf~sAQcaF`79ifBqF-YBSpP88g2um$(HHx{2~96!98-|=6X zNHbYjpboD+*5`1F-*pD^{(nDQ49=EZgAcL2)M*A| zrKh0=?UEQ1X~yfmEDT85tRwx>VCF#JS)8mUB5h5ugfFWqPD>7KDNBS$*j4tq$(T@n z&A~Mg>JZc!k(n)j+v-@tN(6r_Z?eeiamZH$C-AH<*DSg2`v#uJk&2~^yRAfbJ~hTU z>U})CiMA3t9Nn}Se5X+pRD^b<|FBAT;VV6E3vvuTdO z(gZE6ghb{n<{h3oqBvjg^s;1j8diSUKr};D^*qbpv?h9M$xjR$NoMaW#KzG2U;;>V z33L5BAOYX;?~CCYf_MFg!ETvVe2(K*m5g9VW5386rkbVfPlhW+cdZdH(?#`0Cht7n zYwXC{VtKTN%g?dgXj*o4gKdExn8U9FSJOUfBBL|;j?wQQ{}oqd578t;nZt>u7FfiE zrZez14s5^Av|xL)7<;;z;HehJOCrz3v0JgXqtT>g#qz0T%H=$#2yy1IraWpQtM-cO nebH4Yf{QIq)SGX*|5Z}>Ps!x7OTL2#!3%O92pf8Ht&jT~U2G_8 diff --git a/src/text_buffer.c b/src/text_buffer.c index 3d89b85..8b6a2c0 100644 --- a/src/text_buffer.c +++ b/src/text_buffer.c @@ -37,7 +37,7 @@ text_buffer* tb_init(text_buffer* tb, int mem_kb, const char* fname) { tb->x_ = 0; tb->fname_[0] = 0; - if (fname != NULL && !tb_load(tb, fname)) { + if (!tb_load(tb, fname)) { lb_destroy(&tb->lb_); cb_destroy(&tb->cb_); return NULL; @@ -380,7 +380,7 @@ static bool tb_read(uint8_t fh, text_buffer* tb, int sz) { bool tb_load(text_buffer* tb, const char* fname) { if (fname == NULL) { - return false; + fname = "aed.txt"; } int fsz = strlen(fname);