[prev in list] [next in list] [prev in thread] [next in thread] 

List:       proftpd-committers
Subject:    [ProFTPD-committers] proftpd/src dirtree.c,1.266,1.267
From:       TJ Saunders <castaglia () users ! sourceforge ! net>
Date:       2012-12-28 22:09:44
Message-ID: E1Toi7e-0002Cc-K3 () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/proftp/proftpd/src
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27512/src

Modified Files:
	dirtree.c 
Log Message:

Stylistic nits; no functional change.


Index: dirtree.c
===================================================================
RCS file: /cvsroot/proftp/proftpd/src/dirtree.c,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -d -r1.266 -r1.267
--- dirtree.c	10 Oct 2012 06:31:54 -0000	1.266
+++ dirtree.c	28 Dec 2012 22:09:42 -0000	1.267
@@ -139,14 +139,16 @@
   char *full_path = dir_path;
 
   if (session.chroot_path) {
-    if (*dir_path != '/')
+    if (*dir_path != '/') {
       full_path = pdircat(p, session.chroot_path, session.cwd, dir_path, NULL);
 
-    else
+    } else {
       full_path = pdircat(p, session.chroot_path, dir_path, NULL);
+    }
 
-  } else if (*dir_path != '/')
+  } else if (*dir_path != '/') {
     full_path = pdircat(p, session.cwd, dir_path, NULL);
+  }
 
   c = dir_match_path(p, full_path);
 
@@ -666,8 +668,9 @@
       tmp_path = c->name;
 
       if (c->argv[1]) {
-        if (*(char *)(c->argv[1]) == '~')
+        if (*(char *)(c->argv[1]) == '~') {
           c->argv[1] = dir_canonical_path(c->pool, (char *) c->argv[1]);
+        }
 
         tmp_path = pdircat(p, (char *) c->argv[1], tmp_path, NULL);
       }
@@ -766,7 +769,10 @@
   char *tmp = NULL;
   size_t tmplen;
 
-  if (!p || !path || !*path) {
+  if (p == NULL ||
+      path == NULL ||
+      *path == '\0') {
+    errno = EINVAL;
     return NULL;
   }
 
@@ -2184,7 +2190,7 @@
  * directive to.
  */
 
-static config_rec *_find_best_dir(xaset_t *set, char *path, size_t *matchlen) {
+static config_rec *find_best_dir(xaset_t *set, char *path, size_t *matchlen) {
   config_rec *c, *res = NULL, *rres;
   size_t len, pathlen, imatchlen, tmatchlen;
 
@@ -2234,7 +2240,7 @@
 
       if (len < pathlen &&
           strncmp(c->name, path, len) == 0) {
-        rres = _find_best_dir(c->subset ,path, &imatchlen);
+        rres = find_best_dir(c->subset ,path, &imatchlen);
         tmatchlen = _strmatch(path, c->name);
         if (!rres &&
             tmatchlen > *matchlen) {
@@ -2292,7 +2298,7 @@
         xaset_remove(c->parent->subset, (xasetmember_t *) c);
 
       } else {
-        newparent = _find_best_dir(set, c->name, &tmp);
+        newparent = find_best_dir(set, c->name, &tmp);
         if (newparent) {
           if (!newparent->subset)
             newparent->subset = xaset_create(newparent->pool, NULL);


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
ProFTPD Committers Mailing List
proftpd-committers@proftpd.org
https://lists.sourceforge.net/lists/listinfo/proftp-committers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic