]> Nishi Git Mirror - libw3.git/commitdiff
segfault fix
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 05:48:10 +0000 (05:48 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 05:48:10 +0000 (05:48 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@84 d27a3e52-49c5-7645-884c-6793ebffc270

Example/W3B/Makefile
Example/W3B/w3b.c
Example/fetch/Makefile

index 8b1f4e255b24027decc7e949776a82328423000e..e811bca690f92f50fb912385a888d05e47d7ba5a 100644 (file)
@@ -2,10 +2,10 @@
 .PHONY: clean install
 
 ./w3b: ./w3b.o $(RESFILE)
-       $(CC) -o $@ -L ../../Library $^ -lw3
+       $(CC) -g -o $@ -L ../../Library $^ -lw3
 
 ./%.o: ./%.c
-       $(CC) -c -o $@ -I ../../Library $<
+       $(CC) -g -c -o $@ -I ../../Library $<
 
 ../libw3.res:
        $(MAKE) -C .. ./libw3.res WINDRES=$(WINDRES)
index 258b0a8b003143e2da61c96289e029deaed47c08..120bd49f00672f66b0179366b6574b303c66dfa6 100644 (file)
@@ -68,7 +68,9 @@ int main(int argc, char** argv) {
        }
        while(true) { /* Loop */
                if(c != '\n' && c != '\r') {
-                       printf("(O)pen, (Q)uit? ");
+                       printf("(O)pen, (Q)uit");
+                       if(acc) printf(", (P)rint all");
+                       printf("? ");
                        fflush(stdout);
                }
                if(scanf("%c", &c) < 0) break;
@@ -83,6 +85,10 @@ int main(int argc, char** argv) {
                        scanf("%s", url);
                        acc = false;
                        break;
+               case 'p':
+                       if(acc){
+                       }
+                       break;
                case '\n':
                case '\r':
                        break;
@@ -90,7 +96,7 @@ int main(int argc, char** argv) {
                        printf("What do you mean?\n");
                        break;
                }
-               if(!acc) {
+               if(!acc && url != NULL) {
                        access_site(url);
                        acc = true;
                }
index fdbaaecd2e9b961be6a797dd8bab7fd98d06045d..3de3103f77bfe793962213e460a4d76f0b23175b 100644 (file)
@@ -2,7 +2,7 @@
 .PHONY: clean install
 
 ./fetch: ./fetch.c $(RESFILE)
-       $(CC) -o $@ -I ../../Library -L ../../Library $^ -lw3
+       $(CC) -g -o $@ -I ../../Library -L ../../Library $^ -lw3
 
 ../libw3.res:
        $(MAKE) -C .. ./libw3.res WINDRES=$(WINDRES)