User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040930
Hi.
Attached is a patch to allow standard comments (prefixed by '#') inside
service files (passed as -f to mDNSResponderPosix).
It ignores comments and blank lines even if they're in the middle of a
block, which may not be considered by some the right behavior, but I'm
sending it in the hope it's useful to other people as it's to me.
I appologize if that's not the right list to send patches, I'm new to this
list (and Zeroconf in general) and I haven't found a better place to do that.
Index: Responder.c
===================================================================
RCS file: /cvs/apsl/mDNSResponder/mDNSPosix/Responder.c,v
retrieving revision 1.23
diff -u -r1.23 Responder.c
--- Responder.c 2004/09/17 01:08:54 1.23
+++ Responder.c 2004/11/02 18:24:52
@@ -554,7 +554,12 @@
static mDNSBool ReadALine(char *buf, size_t bufSize, FILE *fp)
{
- mDNSBool good = (fgets(buf, bufSize, fp) != NULL);
+ mDNSBool good;
+
+ do {
+ good = (fgets(buf, bufSize, fp) != NULL);
+ } while (good && (buf[0] == '#' || buf[0] == '\r' || buf[0] == '\n'));
+
if (good)
{
size_t len = strlen(buf);
@@ -584,10 +589,14 @@
mDNSu8 text[sizeof(RDataBody)];
mDNSu16 textLen = 0;
char port[256];
- // Skip over any blank lines.
+
+ // Skip over any blank lines or comments.
do {
ch = fgetc(fp);
- } while ( ch == '\n' || ch == '\r' );
+ if (ch == '#') {
+ fgets(rawText, sizeof(rawText), fp);
+ }
+ } while ( ch == '\n' || ch == '\r' || ch == '#');
if (ch != EOF) {
good = (ungetc(ch, fp) == ch);
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Rendezvous-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/rendezvous-dev/email@hidden
This email sent to email@hidden