]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - string.c
s_a_r_list(): return NULL on errors
[paraslash.git] / string.c
index 07f54a07155d5ee385c0c1e044c21017906688ce..156404c48ccf7036db2b875c1f1c3832a2a6f123 100644 (file)
--- a/string.c
+++ b/string.c
@@ -210,8 +210,8 @@ __must_check __malloc char *para_basename(const char *name)
  * string which may contain a single string conversion specifier which gets
  * replaced by 'arg'.
  *
  * string which may contain a single string conversion specifier which gets
  * replaced by 'arg'.
  *
- * \return A string in which all matches in \a src are replaced, or NULL if \a
- * macro_name was not found in \a src.  Caller must free the result.
+ * \return A string in which all matches in \a src are replaced, or NULL if an
+ * syntax error was encountered. Caller must free the result.
  *
  * \sa regcomp(3)
  */
  *
  * \sa regcomp(3)
  */
@@ -273,8 +273,8 @@ __must_check __malloc char *s_a_r_list(struct para_macro *macro_list, char *src)
        while (mp->name) {
                ret = s_a_r(tmp, mp->name, mp->replacement);
                free(tmp);
        while (mp->name) {
                ret = s_a_r(tmp, mp->name, mp->replacement);
                free(tmp);
-               if (!ret)
-                       return src; /* FIXME: shouldn't we continue here? */
+               if (!ret) /* syntax error */
+                       return NULL;
                tmp = ret;
                mp++;
        }
                tmp = ret;
                mp++;
        }