git-apply --whitespace=fix: fix whitespace fuzz introduced by previous run
[gitweb.git] / interpolate.c
index 3de583238d854675ae872047a2d2b7fb09a66969..6ef53f246511a1943e375d5d5913a4ec52e2c663 100644 (file)
@@ -73,8 +73,12 @@ unsigned long interpolate(char *result, unsigned long reslen,
                        /* Check for valid interpolation. */
                        if (i < ninterps) {
                                value = interps[i].value;
-                               valuelen = strlen(value);
+                               if (!value) {
+                                       src += namelen;
+                                       continue;
+                               }
 
+                               valuelen = strlen(value);
                                if (newlen + valuelen < reslen) {
                                        /* Substitute. */
                                        memcpy(dest, value, valuelen);