From 3cff457c6d6a17a0ec8c7b9587b7f093ae46d3ea Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 1 Jul 2008 09:29:02 +0000 Subject: [PATCH] More changes to support the shell script. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402321 --- tools/daemon/smud_connections.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/daemon/smud_connections.cpp b/tools/daemon/smud_connections.cpp index e401e607..80316bd7 100644 --- a/tools/daemon/smud_connections.cpp +++ b/tools/daemon/smud_connections.cpp @@ -283,12 +283,18 @@ MD5Status ConnectionPool::GetMD5UpdateStatus( const char *md5 , smud_connection } char filename[100]; - fgets(filename, sizeof(filename), file); - if (filename[strlen(filename)-1] == '\n') + filename[0] = '\n'; + + while (filename[0] == '\n') { - filename[strlen(filename)-1] = '\0'; + fgets(filename, sizeof(filename), file); + if (filename[strlen(filename)-1] == '\n') + { + filename[strlen(filename)-1] = '\0'; + } } + printf("Filename is %s\n", filename); //We now need to match this filename with one of our mmap'd files in memory and store it until send gets called.