]> git.mdlowis.com Git - projs/tide.git/commitdiff
minor tweak to parsing to allow spaces in regexes. Correct parsing should be reevaluated
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 7 Nov 2019 02:22:57 +0000 (21:22 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 7 Nov 2019 02:22:57 +0000 (21:22 -0500)
config.h
src/fetch.c

index 45f48cd1b7c956823d8fc97d299a82fb399ffe2d..e322d5f8de0fadc7b132982f155e763fcc248b2f 100644 (file)
--- a/config.h
+++ b/config.h
@@ -31,7 +31,7 @@ static char* SedCmd[] = { "sed", "-Ee", 0, 0 };
 static char* FetchCmd[] = { "fetch", 0, 0 };
 
 /* Default tag region text in editor windows */
-static char* TagString = "Del Put | Font Tabs Eol | x+ w+ !st | Find ";
+static char* TagString = "Del Put Get | Font Tabs Eol | x+ w+ !st | Find ";
 
 /* List of font patterns available to the editor */
 static char* Fonts[2] = {
index 2f0aa901aace708eb432c0b5e17e6811e4e28160..e10f9153137234fb8794d1fb0f3d963780da8227 100644 (file)
@@ -313,6 +313,21 @@ static char* nextfield(char** raw)
     return (field && *field ? field : NULL);
 }
 
+static char* lastfield(char** raw)
+{
+    char* field = *raw;
+    /* skip whitespace */
+    for (; *field && isspace(*field); field++);
+
+    char* eof = field;
+    for (; *eof && *eof != '\n'; eof++);
+    *eof = '\0';
+    *raw = eof + 1;
+
+    return (field && *field ? field : NULL);
+}
+
+
 static void parse_args1(int type, Rule* rule, char* args)
 {
     rule->type = type;
@@ -328,7 +343,7 @@ static void parse_args2(int type, Rule* rule, char* args)
 {
     rule->type = type;
     rule->arg1 = nextfield(&args);
-    rule->arg2 = nextfield(&args);
+    rule->arg2 = lastfield(&args);
     if (!rule->arg1 || !rule->arg2)
     {
         printf("action '%s' requires two arguments\n", type2str(type));