Skip to content

Commit 2a10072

Browse files
author
nixnodes
committed
can give a directive as option to '?e'
1 parent ec93610 commit 2a10072

File tree

4 files changed

+64
-20
lines changed

4 files changed

+64
-20
lines changed

MANUAL

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ Updated: 10/03/2016
348348
u - Gets the value of <directive>
349349
p - Returns 1 if value has been accessed with 'u' option, 0 otherwise
350350

351-
?e <field>:<value>
352-
Write string <value> to <field> of the currently processed log.
351+
?e <field>:<directive|value>
352+
Write the result of <directive> or a static <value> to <field> of the currently processed log.
353353

354354
Strings are automatically converted to integers where necessary.
355355

Makefile.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ distdir: $(DISTFILES)
502502
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
503503
|| chmod -R a+r "$(distdir)"
504504
dist-gzip: distdir
505-
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
505+
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
506506
$(am__post_remove_distdir)
507507

508508
dist-bzip2: distdir
@@ -528,7 +528,7 @@ dist-shar: distdir
528528
@echo WARNING: "Support for shar distribution archives is" \
529529
"deprecated." >&2
530530
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
531-
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
531+
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
532532
$(am__post_remove_distdir)
533533

534534
dist-zip: distdir
@@ -546,7 +546,7 @@ dist dist-all:
546546
distcheck: dist
547547
case '$(DIST_ARCHIVES)' in \
548548
*.tar.gz*) \
549-
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
549+
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
550550
*.tar.bz2*) \
551551
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
552552
*.tar.lz*) \
@@ -556,7 +556,7 @@ distcheck: dist
556556
*.tar.Z*) \
557557
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
558558
*.shar.gz*) \
559-
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
559+
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
560560
*.zip*) \
561561
unzip $(distdir).zip ;;\
562562
esac

aclocal.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the build system entirely.
2121
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2222

2323
# longlong.m4 serial 17
24-
dnl Copyright (C) 1999-2007, 2009-2015 Free Software Foundation, Inc.
24+
dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
2525
dnl This file is free software; the Free Software Foundation
2626
dnl gives unlimited permission to copy and/or distribute it,
2727
dnl with or without modifications, as long as this notice is preserved.

src/lref.c

+57-13
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ dt_rval_spec_slen (void *arg, char *match, char *output, size_t max_size,
314314
{
315315
return "0";
316316
}
317+
317318
return output;
318319
}
319320

@@ -2186,11 +2187,39 @@ rt_af_htget (void *arg, char *match, char *output, size_t max_size,
21862187

21872188
}
21882189

2190+
static char *
2191+
dt_rval_setstr2 (void *arg, char *match, char *output, size_t max_size,
2192+
void *mppd)
2193+
{
2194+
2195+
__d_drt_h _mppd = (__d_drt_h ) mppd;
2196+
2197+
char *p_o = _mppd->fp_rval1 (arg, match, output, max_size,
2198+
((__d_drt_h ) mppd)->mppd_next);
2199+
2200+
if (NULL == p_o)
2201+
{
2202+
goto _ex;
2203+
}
2204+
2205+
if (0 == _mppd->hdl->g_proc0 (arg, _mppd->chb0, p_o))
2206+
{
2207+
print_str ("ERROR: dt_rval_setstr: unable to set value, key '%s'\n",
2208+
_mppd->chb0);
2209+
}
2210+
2211+
_ex: ;
2212+
2213+
output[0] = 0x0;
2214+
output[1] = 0x31;
2215+
2216+
return output;
2217+
}
2218+
21892219
static char *
21902220
dt_rval_setstr (void *arg, char *match, char *output, size_t max_size,
21912221
void *mppd)
21922222
{
2193-
21942223
__d_drt_h _mppd = (__d_drt_h ) mppd;
21952224

21962225
if (0 == _mppd->hdl->g_proc0 (arg, _mppd->chb0, _mppd->chb1))
@@ -2218,33 +2247,48 @@ rt_af_setstr (void *arg, char *match, char *output, size_t max_size,
22182247

22192248
if (NULL == ptr || ptr[0] == 0x0)
22202249
{
2221-
print_str ("ERROR: rt_af_setstr: could not key: %s\n", match);
2250+
print_str ("ERROR: rt_af_setstr: could not resolve key: %s\n", match);
22222251
return NULL;
22232252
}
22242253

22252254
if (l_next_ref == NULL)
22262255
{
2227-
print_str ("ERROR: rt_af_setstr: no value given");
2256+
print_str ("ERROR: rt_af_setstr: no value given\n");
22282257
return NULL;
22292258
}
22302259

22312260
mppd->chb0 = strdup (ptr);
22322261

2233-
ptr = l_mppd_shell_ex ((char*) l_next_ref, mppd->tp_b0, sizeof(mppd->tp_b0),
2234-
&l_next_ref,
2235-
LMS_EX_L,
2236-
LMS_EX_R, F_MPPD_SHX_TZERO);
2262+
mppd->mppd_next = l_mppd_create_copy (mppd);
22372263

2238-
if (NULL == ptr || ptr[0] == 0x0)
2264+
mppd->fp_rval1 = mppd->hdl->g_proc1_lookup (arg, (char*) l_next_ref, output,
2265+
max_size, mppd->mppd_next);
2266+
2267+
if (NULL == mppd->fp_rval1)
22392268
{
2240-
print_str ("ERROR: rt_af_setstr: could not resolve value: %s\n",
2241-
(char*) l_next_ref);
2242-
return NULL;
2269+
2270+
ptr = l_mppd_shell_ex ((char*) l_next_ref, mppd->tp_b0,
2271+
sizeof(mppd->tp_b0), &l_next_ref,
2272+
LMS_EX_L,
2273+
LMS_EX_R, F_MPPD_SHX_TZERO);
2274+
2275+
if (NULL == ptr || ptr[0] == 0x0)
2276+
{
2277+
print_str ("ERROR: rt_af_setstr: could not resolve value: %s\n",
2278+
(char*) l_next_ref);
2279+
return NULL;
2280+
}
2281+
2282+
mppd->chb1 = strdup (ptr);
2283+
2284+
return as_ref_to_val_lk (match, dt_rval_setstr, mppd, "%s");
22432285
}
2286+
else
2287+
{
22442288

2245-
mppd->chb1 = strdup (ptr);
2289+
return as_ref_to_val_lk (match, dt_rval_setstr2, mppd, "%s");
22462290

2247-
return as_ref_to_val_lk (match, dt_rval_setstr, mppd, "%s");
2291+
}
22482292

22492293
}
22502294

0 commit comments

Comments
 (0)