repo: uritools
action: commit
revision: 
path_from: 
revision_from: 96adcfcc7775e89f8a8d084215a07d3f2662c6a0:
path_to: 
revision_to: 
git.thebackupbox.net
uritools
git clone git://git.thebackupbox.net/uritools
commit 96adcfcc7775e89f8a8d084215a07d3f2662c6a0
Author: epoch 
Date:   Fri Aug 19 02:16:49 2022 -0500

    didn't actually need a goto. found a way to do it with one less line anyway

diff --git a/urigetline.c b/urigetline.c
index 92b4de7c33a8a700762898fc420bb4fb61219f15..
index ..2de012692aa5f6efadd1908692dc366252551798 100644
--- a/urigetline.c
+++ b/urigetline.c
@@ -77,10 +77,10 @@ int main(int argc,char *argv[]) {//argument needs to be the URI
     a=line;
     matches=1;
     for(;a;) {
+      if(!*a) break;
       rule=MATCH_PATTERN;
       j=0;
       switch(a[0]) {
-	case 0: j=1; goto match; break;
         case '-': j=1; rule=MATCH_PATTERN; break;
         case 'n': j=1; rule=MATCH_UNEXIST; break;
         case 'r': j=1; rule=MATCH_REVERSE; break;
@@ -121,7 +121,6 @@ int main(int argc,char *argv[]) {//argument needs to be the URI
       a=c;
     }
     if(matches) {
-match:
       //printf("comm: %s\n",command);
       printf("%s\n",command);
       if(!all) return ret;//bail early if we only need first match

-----END OF PAGE-----