* mdocml: Clean up roff_getstrn() function.
@ 2011-07-27 13:42 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-07-27 13:42 UTC (permalink / raw)
To: source
Log Message:
-----------
Clean up roff_getstrn() function.
Modified Files:
--------------
mdocml:
roff.c
Revision Data
-------------
Index: roff.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -Lroff.c -Lroff.c -u -p -r1.156 -r1.157
--- roff.c
+++ roff.c
@@ -1519,11 +1519,12 @@ roff_getstrn(const struct roff *r, const
{
const struct roffstr *n;
- n = r->first_string;
- while (n && (strncmp(name, n->name, len) || '\0' != n->name[(int)len]))
- n = n->next;
+ for (n = r->first_string; n; n = n->next)
+ if (0 == strncmp(name, n->name, len) &&
+ '\0' == n->name[(int)len])
+ return(n->string);
- return(n ? n->string : NULL);
+ return(NULL);
}
static void
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-27 13:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-27 13:42 mdocml: Clean up roff_getstrn() function kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).