From: Jan D Date: Sat, 14 Aug 2010 06:42:09 +0000 (+0200) Subject: * doc.c (Fsnarf_documentation): Set skip_file only if p[1] is S. X-Git-Tag: emacs-pretest-23.2.90~139^2~25 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=983b8302209c32043178edd8b89941857699d6b4;p=emacs.git * doc.c (Fsnarf_documentation): Set skip_file only if p[1] is S. --- diff --git a/src/ChangeLog b/src/ChangeLog index f36714d3792..2f011db3784 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-08-14 Jan Djärv + + * doc.c (Fsnarf_documentation): Set skip_file only if p[1] is S. + 2010-08-13 Jan Djärv * doc.c (Fsnarf_documentation): Initialize skip_file before diff --git a/src/doc.c b/src/doc.c index 6543eb41db1..d1cc6e48fcf 100644 --- a/src/doc.c +++ b/src/doc.c @@ -640,25 +640,28 @@ the same file name is found in the `doc-directory'. */) p = buf; end = buf + (filled < 512 ? filled : filled - 128); while (p != end && *p != '\037') p++; - /* p points to ^_Ffunctionname\n or ^_Vvarname\n. */ + /* p points to ^_Ffunctionname\n or ^_Vvarname\n or ^_Sfilename\n. */ if (p != end) { end = (char *) index (p, '\n'); - skip_file = 0; /* See if this is a file name, and if it is a file in build-files. */ - if (p[1] == 'S' && end - p > 4 && end[-2] == '.' - && (end[-1] == 'o' || end[-1] == 'c')) + if (p[1] == 'S') { - int len = end - p - 2; - char *fromfile = alloca (len + 1); - strncpy (fromfile, &p[2], len); - fromfile[len] = 0; - if (fromfile[len-1] == 'c') - fromfile[len-1] = 'o'; - - skip_file = NILP (Fmember (build_string (fromfile), - Vbuild_files)); + skip_file = 0; + if (end - p > 4 && end[-2] == '.' + && (end[-1] == 'o' || end[-1] == 'c')) + { + int len = end - p - 2; + char *fromfile = alloca (len + 1); + strncpy (fromfile, &p[2], len); + fromfile[len] = 0; + if (fromfile[len-1] == 'c') + fromfile[len-1] = 'o'; + + skip_file = NILP (Fmember (build_string (fromfile), + Vbuild_files)); + } } sym = oblookup (Vobarray, p + 2,