gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27075 - libmicrohttpd/src/examples


From: gnunet
Subject: [GNUnet-SVN] r27075 - libmicrohttpd/src/examples
Date: Thu, 9 May 2013 12:47:18 +0200

Author: grothoff
Date: 2013-05-09 12:47:18 +0200 (Thu, 09 May 2013)
New Revision: 27075

Modified:
   libmicrohttpd/src/examples/Makefile.am
   libmicrohttpd/src/examples/demo.c
Log:
-bugfixes

Modified: libmicrohttpd/src/examples/Makefile.am
===================================================================
--- libmicrohttpd/src/examples/Makefile.am      2013-05-09 09:45:53 UTC (rev 
27074)
+++ libmicrohttpd/src/examples/Makefile.am      2013-05-09 10:47:18 UTC (rev 
27075)
@@ -43,7 +43,7 @@
 noinst_PROGRAMS += \
   post_example 
 if HAVE_MAGIC
-noinst_PROGRAMS += \
+bin_PROGRAMS = \
   demo 
 endif
 endif

Modified: libmicrohttpd/src/examples/demo.c
===================================================================
--- libmicrohttpd/src/examples/demo.c   2013-05-09 09:45:53 UTC (rev 27074)
+++ libmicrohttpd/src/examples/demo.c   2013-05-09 10:47:18 UTC (rev 27075)
@@ -37,6 +37,7 @@
 #include <dirent.h>
 #include <magic.h>
 #include <limits.h>
+#include <ctype.h>
 
 /**
  * Number of threads to run in the thread pool.  Should (roughly) match
@@ -280,7 +281,7 @@
       rdc->off += snprintf (&rdc->buf[rdc->off], 
                            rdc->buf_len - rdc->off,
                            "<li><a href=\"/%s\">%s</a></li>\n",
-                           de->d_name,
+                           fullname,
                            de->d_name);
     }
   (void) closedir (dir);
@@ -472,6 +473,7 @@
                     size_t size)
 {
   struct UploadContext *uc = cls;
+  int i;
 
   if (0 == strcmp (key, "category"))
     return do_append (&uc->category, data, size);
@@ -529,7 +531,10 @@
                "%s/%s/%s",
                uc->language,
                uc->category,
-               filename);      
+               filename); 
+      for (i=strlen (fn)-1;i>=0;i--)
+       if (! isprint ((int) fn[i]))
+         fn[i] = '_';
       uc->fd = open (fn, 
                     O_CREAT | O_EXCL 
 #if O_LARGEFILE




reply via email to

[Prev in Thread] Current Thread [Next in Thread]