]> Nishi Git Mirror - libw3.git/commitdiff
url
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 03:54:11 +0000 (03:54 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 03:54:11 +0000 (03:54 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@76 d27a3e52-49c5-7645-884c-6793ebffc270

Example/W3B/Makefile
Example/W3B/url.c [new file with mode: 0644]
Example/W3B/w3b.c

index de9db0ea85b0ab796f6f472119c1890ce4e1a97b..c630806cd315415f4f2aaf3595d5f8d681e4d8de 100644 (file)
@@ -1,8 +1,11 @@
 # $Id$
 .PHONY: clean install
 
-./w3b: ./w3b.c $(RESFILE)
-       $(CC) -o $@ -I ../../Library -L ../../Library $^ -lw3
+./w3b: ./w3b.o ./url.o $(RESFILE)
+       $(CC) -o $@ -L ../../Library $^ -lw3
+
+./%.o: ./%.c
+       $(CC) -c -o $@ -I ../../Library $<
 
 ../libw3.res:
        $(MAKE) -C .. ./libw3.res WINDRES=$(WINDRES)
diff --git a/Example/W3B/url.c b/Example/W3B/url.c
new file mode 100644 (file)
index 0000000..354d6f4
--- /dev/null
@@ -0,0 +1,4 @@
+/* $Id$
+ *
+ * URL parser
+ */
index 621099c445303fca381e67d89382de1eb08c0e5b..1f2af9a3aa94f145cebb73506eb6b551bc81a918 100644 (file)
@@ -39,7 +39,7 @@ int main(int argc, char** argv) {
                                printf("(O)pen, (Q)uit? ");
                                fflush(stdout);
                        }
-                       scanf("%c", &c);
+                       if(scanf("%c", &c) < 0) break;
                        switch(tolower(c)){
                                case 'q':
                                        goto exitnow;
@@ -59,5 +59,6 @@ int main(int argc, char** argv) {
                        }
                }
        }
+       printf("\n");
 exitnow:;
 }