[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4216 - in GNUnet/src: applications/fs/ecrs applications/fs
From: |
durner |
Subject: |
[GNUnet-SVN] r4216 - in GNUnet/src: applications/fs/ecrs applications/fs/fsui applications/fs/module applications/fs/tools applications/fs/uritrack applications/identity applications/testbed util/loggers |
Date: |
Sat, 6 Jan 2007 04:15:54 -0800 (PST) |
Author: durner
Date: 2007-01-06 04:15:39 -0800 (Sat, 06 Jan 2007)
New Revision: 4216
Modified:
GNUnet/src/applications/fs/ecrs/download.c
GNUnet/src/applications/fs/ecrs/namespace.c
GNUnet/src/applications/fs/ecrs/uri.c
GNUnet/src/applications/fs/fsui/download.c
GNUnet/src/applications/fs/fsui/upload.c
GNUnet/src/applications/fs/module/ondemand.c
GNUnet/src/applications/fs/tools/gnunet-insert.c
GNUnet/src/applications/fs/uritrack/file_info.c
GNUnet/src/applications/identity/hostkey.c
GNUnet/src/applications/testbed/testbed.c
GNUnet/src/util/loggers/file.c
Log:
DIR_SEPARATOR
Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c 2007-01-06 10:54:58 UTC (rev
4215)
+++ GNUnet/src/applications/fs/ecrs/download.c 2007-01-06 12:15:39 UTC (rev
4216)
@@ -1278,11 +1278,11 @@
strcpy(path, realFN);
pos = path;
while (*pos != '\0') {
- if (*pos == '/') {
+ if (*pos == DIR_SEPARATOR) {
*pos = '\0';
if ( (0 == STAT(path, &buf)) &&
(! S_ISDIR(buf.st_mode)) ) {
- *pos = '/';
+ *pos = DIR_SEPARATOR;
memmove(pos + strlen(GNUNET_DIRECTORY_EXT),
pos,
strlen(pos));
@@ -1291,7 +1291,7 @@
strlen(GNUNET_DIRECTORY_EXT));
pos += strlen(GNUNET_DIRECTORY_EXT);
} else {
- *pos = '/';
+ *pos = DIR_SEPARATOR;
}
}
pos++;
@@ -1407,7 +1407,7 @@
len = strlen(rdir);
do {
while ( (len > 0) &&
- (rdir[len] != '/') )
+ (rdir[len] != DIR_SEPARATOR) )
len--;
rdir[len] = '\0';
} while ( (len > 0) && (0 == rmdir(rdir)) );
Modified: GNUnet/src/applications/fs/ecrs/namespace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespace.c 2007-01-06 10:54:58 UTC (rev
4215)
+++ GNUnet/src/applications/fs/ecrs/namespace.c 2007-01-06 12:15:39 UTC (rev
4216)
@@ -53,7 +53,7 @@
fileName = MALLOC(strlen(gnHome) + strlen(PSEUDODIR) + strlen(name) + 2);
strcpy(fileName, gnHome);
FREE(gnHome);
- strcat(fileName, "/");
+ strcat(fileName, DIR_SEPARATOR_STR);
strcat(fileName, PSEUDODIR);
disk_directory_create(ectx,
fileName);
Modified: GNUnet/src/applications/fs/ecrs/uri.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/uri.c 2007-01-06 10:54:58 UTC (rev
4215)
+++ GNUnet/src/applications/fs/ecrs/uri.c 2007-01-06 12:15:39 UTC (rev
4216)
@@ -281,7 +281,7 @@
return SYSERR;
pos += strlen(ECRS_SUBSPACE_INFIX);
if ( (slen < pos+sizeof(EncName)+1) ||
- (uri[pos+sizeof(EncName)-1] != '/') )
+ (!(uri[pos+sizeof(EncName)-1] == '/') || (uri[pos+sizeof(EncName)-1] ==
'\\')) )
return SYSERR;
up = STRDUP(uri);
Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c 2007-01-06 10:54:58 UTC (rev
4215)
+++ GNUnet/src/applications/fs/fsui/download.c 2007-01-06 12:15:39 UTC (rev
4216)
@@ -298,8 +298,9 @@
totalBytes = ECRS_fileSize(dl->fi.uri);
fn = MALLOC(strlen(dl->filename) + strlen(GNUNET_DIRECTORY_EXT) + 1);
strcpy(fn, dl->filename);
- if (fn[strlen(fn)-1] == '/') {
- fn[strlen(fn)-1] = '\0';
+ fd = strlen(fn)-1;
+ if (fn[fd] == '/' || fn[fd] == '\\') {
+ fn[fd] = '\0';
strcat(fn, GNUNET_DIRECTORY_EXT);
}
fd = disk_file_open(ectx,
Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c 2007-01-06 10:54:58 UTC (rev
4215)
+++ GNUnet/src/applications/fs/fsui/upload.c 2007-01-06 12:15:39 UTC (rev
4216)
@@ -303,18 +303,18 @@
-- we do not want to publish $HOME or similar
trivially deanonymizing information */
tpos = strlen(utc->filename) - 1;
- if ( (utc->filename[tpos] == '/') &&
+ if ( (utc->filename[tpos] == DIR_SEPARATOR) &&
(tpos > 0) )
tpos--;
while ( (tpos > 0) &&
- (utc->filename[tpos] != '/') )
+ (utc->filename[tpos] != DIR_SEPARATOR) )
tpos--;
pfn = MALLOC(strlen(&utc->filename[tpos+1]) + 2);
strcpy(pfn, &utc->filename[tpos+1]);
if ( (utc->child != NULL) &&
( (strlen(pfn) == 0) ||
- (pfn[strlen(pfn)-1] != '/') ) )
- strcat(pfn, "/");
+ (pfn[strlen(pfn)-1] != DIR_SEPARATOR) ) )
+ strcat(pfn, DIR_SEPARATOR_STR);
ECRS_addToMetaData(utc->meta,
EXTRACTOR_FILENAME,
pfn);
Modified: GNUnet/src/applications/fs/module/ondemand.c
===================================================================
--- GNUnet/src/applications/fs/module/ondemand.c 2007-01-06 10:54:58 UTC
(rev 4215)
+++ GNUnet/src/applications/fs/module/ondemand.c 2007-01-06 12:15:39 UTC
(rev 4216)
@@ -82,7 +82,7 @@
&enc);
fn = MALLOC(strlen(index_directory) + sizeof(EncName) + 1);
strcpy(fn, index_directory);
- strcat(fn, "/");
+ strcat(fn, DIR_SEPARATOR_STR);
strcat(fn, (char*) &enc);
return fn;
}
Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c 2007-01-06 10:54:58 UTC
(rev 4215)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c 2007-01-06 12:15:39 UTC
(rev 4216)
@@ -155,8 +155,8 @@
fullName = MALLOC(strlen(dir) + strlen(fn) + 2);
strcpy(fullName, dir);
- if (dir[strlen(dir)-1] != '/')
- strcat(fullName, "/");
+ if (dir[strlen(dir)-1] != DIR_SEPARATOR)
+ strcat(fullName, DIR_SEPARATOR_STR);
strcat(fullName, fn);
printf(_("Keywords for file `%s':\n"),
fullName);
@@ -389,11 +389,11 @@
dirname = string_expandFileName(ectx, filename);
GE_ASSERT(ectx, dirname != NULL);
while ( (strlen(dirname) > 0) &&
- (dirname[strlen(dirname)-1] == '/') )
+ (dirname[strlen(dirname)-1] == DIR_SEPARATOR) )
dirname[strlen(dirname)-1] = '\0';
fname = dirname;
- while (strstr(fname, "/") != NULL)
- fname = strstr(fname, "/") + 1;
+ while (strstr(fname, DIR_SEPARATOR_STR) != NULL)
+ fname = strstr(fname, DIR_SEPARATOR_STR) + 1;
GE_ASSERT(ectx,
fname != dirname);
fname[-1] = '\0';
Modified: GNUnet/src/applications/fs/uritrack/file_info.c
===================================================================
--- GNUnet/src/applications/fs/uritrack/file_info.c 2007-01-06 10:54:58 UTC
(rev 4215)
+++ GNUnet/src/applications/fs/uritrack/file_info.c 2007-01-06 12:15:39 UTC
(rev 4216)
@@ -72,7 +72,7 @@
&pfx);
nw = MALLOC(strlen(pfx) + strlen(STATE_NAME) + 2);
strcpy(nw, pfx);
- strcat(nw, "/");
+ strcat(nw, DIR_SEPARATOR_STR);
strcat(nw, STATE_NAME);
FREE(pfx);
disk_directory_create_for_file(ectx,
@@ -92,7 +92,7 @@
&pfx);
nw = MALLOC(strlen(pfx) + strlen(TRACK_OPTION) + 2);
strcpy(nw, pfx);
- strcat(nw, "/");
+ strcat(nw, DIR_SEPARATOR_STR);
strcat(nw, TRACK_OPTION);
FREE(pfx);
disk_directory_create_for_file(ectx,
Modified: GNUnet/src/applications/identity/hostkey.c
===================================================================
--- GNUnet/src/applications/identity/hostkey.c 2007-01-06 10:54:58 UTC (rev
4215)
+++ GNUnet/src/applications/identity/hostkey.c 2007-01-06 12:15:39 UTC (rev
4216)
@@ -129,8 +129,8 @@
hostkeyfile = MALLOC(strlen(gnHome) + strlen(HOSTKEYFILE)+2);
strcpy(hostkeyfile, gnHome);
FREE(gnHome);
- if (hostkeyfile[strlen(hostkeyfile)-1] != '/')
- strcat(hostkeyfile, "/");
+ if (hostkeyfile[strlen(hostkeyfile)-1] != DIR_SEPARATOR)
+ strcat(hostkeyfile, DIR_SEPARATOR_STR);
strcat(hostkeyfile, HOSTKEYFILE);
res = 0;
if (YES == disk_file_test(ectx,
Modified: GNUnet/src/applications/testbed/testbed.c
===================================================================
--- GNUnet/src/applications/testbed/testbed.c 2007-01-06 10:54:58 UTC (rev
4215)
+++ GNUnet/src/applications/testbed/testbed.c 2007-01-06 12:15:39 UTC (rev
4216)
@@ -511,7 +511,7 @@
tmp = getConfigurationString("TESTBED",
"UPLOAD-DIR");
if (tmp == NULL)
- tmp = STRDUP("/");
+ tmp = STRDUP(DIR_SEPARATOR_STR);
dir = expandFileName(tmp);
disk_directory_create(ectx, dir);
FREE(tmp);
@@ -848,7 +848,7 @@
filename = MALLOC(strlen(filename) + strlen(gnHome) + 2); /*2: /, \0 */
strcpy(filename, gnHome);
- strcat(filename, "/");
+ strcat(filename, DIR_SEPARATOR_STR);
strncat(filename,
((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC*)msg)->buf,
end - ((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC*)msg)->buf);
Modified: GNUnet/src/util/loggers/file.c
===================================================================
--- GNUnet/src/util/loggers/file.c 2007-01-06 10:54:58 UTC (rev 4215)
+++ GNUnet/src/util/loggers/file.c 2007-01-06 12:15:39 UTC (rev 4216)
@@ -217,7 +217,7 @@
fctx->filename = name;
dirname = STRDUP(name);
while ( (strlen(dirname) > 0) &&
- (dirname[strlen(dirname)-1] != '/') )
+ (dirname[strlen(dirname)-1] != DIR_SEPARATOR) )
dirname[strlen(dirname)-1] = '\0';
disk_directory_scan(fctx->ectx,
dirname,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4216 - in GNUnet/src: applications/fs/ecrs applications/fs/fsui applications/fs/module applications/fs/tools applications/fs/uritrack applications/identity applications/testbed util/loggers,
durner <=