diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-13 10:21:43 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-13 10:33:34 +0300 |
commit | de3fbe3e8d4dd2a89f7755906d76055784c437cc (patch) | |
tree | 65356dd7b5a9010499550c468e960c93515a7e15 /src/directive.c | |
parent | f569a6f2628b9ddef4dfb4424aff2dad644a8f19 (diff) | |
download | wydawca-de3fbe3e8d4dd2a89f7755906d76055784c437cc.tar.gz wydawca-de3fbe3e8d4dd2a89f7755906d76055784c437cc.tar.bz2 |
Drop gnulib.
* bootstrap: Rewrite.
* bootstrap.conf: Remove.
* configure.ac: Remove gl_EARLY/gl_INIT
* src/backup.c: New file.
* src/txtacc.c (txtacc_finish): Make sure a new entry is
appended only once to the list.
* (all sources): Use grecs memory allocation functions.
* src/wydawca.h" Include fnmatch.h and regex.h
(backup_type): New enum.
(simple_backup_suffix): New extern.
(find_backup_file_name): New proto.
* tests/bkupname.c: New file.
* tests/backup00.at: New file.
* tests/backup01.at: New file.
* tests/backup02.at: New file.
* tests/backup03.at: New file.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
* grecs: Update.
Diffstat (limited to 'src/directive.c')
-rw-r--r-- | src/directive.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/directive.c b/src/directive.c index 08a14df..fadaedf 100644 --- a/src/directive.c +++ b/src/directive.c @@ -25,25 +25,25 @@ directive_parse (struct file_triplet *trp) size_t dcount, i, j; char *p; if (debug_level > 2) logmsg (LOG_DEBUG, _("%s: parsing directive blurb: %s"), trp->file[file_directive].name, trp->blurb); dcount = 0; for (p = trp->blurb; *p; p++) if (*p == '\n') dcount++; - trp->directive = xcalloc (dcount + 1, sizeof trp->directive[0]); + trp->directive = grecs_calloc (dcount + 1, sizeof trp->directive[0]); p = trp->blurb; for (i = j = 0; i < dcount; i++) { trp->directive[j] = p; p = strchr (p, '\n'); if (p) *p++ = 0; if (trim (trp->directive[j]) == 0) /* ignore empty lines */ continue; if (strchr (trp->directive[j], ':') == NULL) { logmsg (LOG_ERR, _("%s: invalid line: %s"), @@ -102,25 +102,25 @@ _directive_seq_get (int n, struct file_triplet *trp, { char *p; size_t len; if (trp->directive[n] == NULL) return 0; p = strchr (trp->directive[n], ':'); len = p - trp->directive[n]; if (len + 1 > trp->tmpsize) { trp->tmpsize = len + 1; - trp->tmp = x2realloc (trp->tmp, &trp->tmpsize); + trp->tmp = grecs_realloc (trp->tmp, trp->tmpsize); } memcpy (trp->tmp, trp->directive[n], len); trp->tmp[len] = 0; *pkey = trp->tmp; for (p++; *p && isspace (*p); p++) ; if (pval) *pval = p; return ++n; } /* Get the first directive from TRP. Point *PKEY to its keyword and @@ -371,25 +371,25 @@ stderr_redirector (const char *tag) } if (pid == 0) { FILE *fp; size_t size = 0; char *buf = NULL; close (p[1]); fp = fdopen (p[0], "r"); if (!fp) _exit (127); - while (getline (&buf, &size, fp) >= 0) + while (grecs_getline (&buf, &size, fp) >= 0) { trim_crlf (buf); logmsg (LOG_NOTICE, "%s: %s", tag, buf); } _exit (0); } close (p[0]); return p[1]; } static int @@ -484,25 +484,25 @@ run_check_script (const char *script, struct file_triplet *trp, execv ("/bin/sh", argv); _exit (127); } /* Master */ free (script_file); close (p[1]); fp = fdopen (p[0], "r"); buf = NULL; size = total = 0; if (debug_level > 2) logmsg (LOG_DEBUG, _("reading script output...")); - while (getline (&buf, &size, fp) > 0) + while (grecs_getline (&buf, &size, fp) > 0) { size_t len = strlen (buf); if (debug_level > 2) logmsg (LOG_DEBUG, _("read: %s"), buf); txtacc_grow (trp->acc, buf, len); total += size; } txtacc_1grow (trp->acc, 0); if (debug_level > 2) logmsg (LOG_DEBUG, _("bytes read: %lu"), (unsigned long)total); fclose (fp); |