Fossil SCM

Minor fix in checking for drive-prefix (!= absolute filename) <p>merge trunk

jan.nijtmans 2012-11-22 12:58 ticket-d17d6e5b17
Commit 6119cb310da07498cc8863ed6baf6eb022375dac
+2 -1
--- src/file.c
+++ src/file.c
@@ -1192,11 +1192,12 @@
11921192
void *fossil_utf8_to_filename(const char *zUtf8){
11931193
#ifdef _WIN32
11941194
WCHAR *zUnicode = fossil_utf8_to_unicode(zUtf8);
11951195
WCHAR *wUnicode = zUnicode;
11961196
/* If path starts with "<drive>:/" or "<drive>:\", don't translate the ':' */
1197
- if ( file_is_absolute_path(zUtf8) ){
1197
+ if( fossil_isalpha(zUtf8[0]) && zUtf8[1]==':'
1198
+ && (zUtf8[2]=='\\' || zUtf8[2]=='/')) {
11981199
wUnicode += 3;
11991200
}
12001201
while( *wUnicode != '\0' ){
12011202
if ( (*wUnicode < 32) || wcschr(L"\"*<>?|:", *wUnicode) ){
12021203
*wUnicode |= 0xF000;
12031204
--- src/file.c
+++ src/file.c
@@ -1192,11 +1192,12 @@
1192 void *fossil_utf8_to_filename(const char *zUtf8){
1193 #ifdef _WIN32
1194 WCHAR *zUnicode = fossil_utf8_to_unicode(zUtf8);
1195 WCHAR *wUnicode = zUnicode;
1196 /* If path starts with "<drive>:/" or "<drive>:\", don't translate the ':' */
1197 if ( file_is_absolute_path(zUtf8) ){
 
1198 wUnicode += 3;
1199 }
1200 while( *wUnicode != '\0' ){
1201 if ( (*wUnicode < 32) || wcschr(L"\"*<>?|:", *wUnicode) ){
1202 *wUnicode |= 0xF000;
1203
--- src/file.c
+++ src/file.c
@@ -1192,11 +1192,12 @@
1192 void *fossil_utf8_to_filename(const char *zUtf8){
1193 #ifdef _WIN32
1194 WCHAR *zUnicode = fossil_utf8_to_unicode(zUtf8);
1195 WCHAR *wUnicode = zUnicode;
1196 /* If path starts with "<drive>:/" or "<drive>:\", don't translate the ':' */
1197 if( fossil_isalpha(zUtf8[0]) && zUtf8[1]==':'
1198 && (zUtf8[2]=='\\' || zUtf8[2]=='/')) {
1199 wUnicode += 3;
1200 }
1201 while( *wUnicode != '\0' ){
1202 if ( (*wUnicode < 32) || wcschr(L"\"*<>?|:", *wUnicode) ){
1203 *wUnicode |= 0xF000;
1204
+4 -4
--- src/main.c
+++ src/main.c
@@ -343,11 +343,11 @@
343343
if(g.db){
344344
db_close(0);
345345
}
346346
}
347347
348
-#if defined(_WIN32)
348
+#if defined(_WIN32) && !defined(__MINGW32__)
349349
/*
350350
** Parse the command-line arguments passed to windows. We do this
351351
** ourselves to work around bugs in the command-line parsing of MinGW.
352352
** It is possible (in theory) to only use this routine when compiling
353353
** with MinGW and to use built-in command-line parsing for MSVC and
@@ -456,11 +456,11 @@
456456
}
457457
argv[argc] = NULL;
458458
*argcPtr = argc;
459459
*((WCHAR ***)argvPtr) = argv;
460460
}
461
-#endif /* defined(_WIN32) */
461
+#endif /* defined(_WIN32) && !defined(__MINGW32__) */
462462
463463
464464
/*
465465
** Convert all arguments from mbcs (or unicode) to UTF-8. Then
466466
** search g.argv for arguments "--args FILENAME". If found, then
@@ -480,17 +480,17 @@
480480
int n; /* Number of bytes in one line */
481481
char *z; /* General use string pointer */
482482
char **newArgv; /* New expanded g.argv under construction */
483483
char const * zFileName; /* input file name */
484484
FILE * zInFile; /* input FILE */
485
-#if defined(_WIN32)
485
+#if defined(_WIN32) && !defined(__MINGW32__)
486486
WCHAR buf[MAX_PATH];
487487
#endif
488488
489489
g.argc = argc;
490490
g.argv = argv;
491
-#if defined(_WIN32)
491
+#if defined(_WIN32) && !defined(__MINGW32__)
492492
parse_windows_command_line(&g.argc, &g.argv);
493493
GetModuleFileNameW(NULL, buf, MAX_PATH);
494494
g.nameOfExe = fossil_unicode_to_utf8(buf);
495495
for(i=0; i<g.argc; i++) g.argv[i] = fossil_unicode_to_utf8(g.argv[i]);
496496
#else
497497
--- src/main.c
+++ src/main.c
@@ -343,11 +343,11 @@
343 if(g.db){
344 db_close(0);
345 }
346 }
347
348 #if defined(_WIN32)
349 /*
350 ** Parse the command-line arguments passed to windows. We do this
351 ** ourselves to work around bugs in the command-line parsing of MinGW.
352 ** It is possible (in theory) to only use this routine when compiling
353 ** with MinGW and to use built-in command-line parsing for MSVC and
@@ -456,11 +456,11 @@
456 }
457 argv[argc] = NULL;
458 *argcPtr = argc;
459 *((WCHAR ***)argvPtr) = argv;
460 }
461 #endif /* defined(_WIN32) */
462
463
464 /*
465 ** Convert all arguments from mbcs (or unicode) to UTF-8. Then
466 ** search g.argv for arguments "--args FILENAME". If found, then
@@ -480,17 +480,17 @@
480 int n; /* Number of bytes in one line */
481 char *z; /* General use string pointer */
482 char **newArgv; /* New expanded g.argv under construction */
483 char const * zFileName; /* input file name */
484 FILE * zInFile; /* input FILE */
485 #if defined(_WIN32)
486 WCHAR buf[MAX_PATH];
487 #endif
488
489 g.argc = argc;
490 g.argv = argv;
491 #if defined(_WIN32)
492 parse_windows_command_line(&g.argc, &g.argv);
493 GetModuleFileNameW(NULL, buf, MAX_PATH);
494 g.nameOfExe = fossil_unicode_to_utf8(buf);
495 for(i=0; i<g.argc; i++) g.argv[i] = fossil_unicode_to_utf8(g.argv[i]);
496 #else
497
--- src/main.c
+++ src/main.c
@@ -343,11 +343,11 @@
343 if(g.db){
344 db_close(0);
345 }
346 }
347
348 #if defined(_WIN32) && !defined(__MINGW32__)
349 /*
350 ** Parse the command-line arguments passed to windows. We do this
351 ** ourselves to work around bugs in the command-line parsing of MinGW.
352 ** It is possible (in theory) to only use this routine when compiling
353 ** with MinGW and to use built-in command-line parsing for MSVC and
@@ -456,11 +456,11 @@
456 }
457 argv[argc] = NULL;
458 *argcPtr = argc;
459 *((WCHAR ***)argvPtr) = argv;
460 }
461 #endif /* defined(_WIN32) && !defined(__MINGW32__) */
462
463
464 /*
465 ** Convert all arguments from mbcs (or unicode) to UTF-8. Then
466 ** search g.argv for arguments "--args FILENAME". If found, then
@@ -480,17 +480,17 @@
480 int n; /* Number of bytes in one line */
481 char *z; /* General use string pointer */
482 char **newArgv; /* New expanded g.argv under construction */
483 char const * zFileName; /* input file name */
484 FILE * zInFile; /* input FILE */
485 #if defined(_WIN32) && !defined(__MINGW32__)
486 WCHAR buf[MAX_PATH];
487 #endif
488
489 g.argc = argc;
490 g.argv = argv;
491 #if defined(_WIN32) && !defined(__MINGW32__)
492 parse_windows_command_line(&g.argc, &g.argv);
493 GetModuleFileNameW(NULL, buf, MAX_PATH);
494 g.nameOfExe = fossil_unicode_to_utf8(buf);
495 for(i=0; i<g.argc; i++) g.argv[i] = fossil_unicode_to_utf8(g.argv[i]);
496 #else
497
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
1313
#
1414
1515
#### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
1616
# By default, this is an empty string (i.e. use the native compiler).
1717
#
18
-# PREFIX =
18
+PREFIX =
1919
# PREFIX = mingw32-
2020
# PREFIX = i686-pc-mingw32-
2121
# PREFIX = i686-w64-mingw32-
22
-PREFIX = x86_64-w64-mingw32-
22
+# PREFIX = x86_64-w64-mingw32-
2323
2424
#### The toplevel directory of the source tree. Fossil can be built
2525
# in a directory that is separate from the source tree. Just change
2626
# the following to point from the build directory to the src/ folder.
2727
#
@@ -35,10 +35,14 @@
3535
# will run on the platform that is doing the build. This is used
3636
# to compile code-generator programs as part of the build process.
3737
# See TCC below for the C compiler for building the finished binary.
3838
#
3939
BCC = gcc
40
+
41
+#### Enable compiling with debug symbols (much larger binary)
42
+#
43
+# FOSSIL_ENABLE_SYMBOLS = 1
4044
4145
#### Enable JSON (http://www.json.org) support using "cson"
4246
#
4347
# FOSSIL_ENABLE_JSON = 1
4448
@@ -112,11 +116,18 @@
112116
# will run on the target platform. This is usually the same
113117
# as BCC, unless you are cross-compiling. This C compiler builds
114118
# the finished binary for fossil. The BCC compiler above is used
115119
# for building intermediate code-generator tools.
116120
#
117
-TCC = $(PREFIX)gcc -g -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
121
+TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
122
+
123
+#### Add the necessary command line options to build with debugging
124
+# symbols, if enabled.
125
+#
126
+ifdef FOSSIL_ENABLE_SYMBOLS
127
+TCC += -g
128
+endif
118129
119130
#### Compile resources for use in building executables that will run
120131
# on the target platform.
121132
#
122133
RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
123134
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
13 #
14
15 #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 # PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
21 # PREFIX = i686-w64-mingw32-
22 PREFIX = x86_64-w64-mingw32-
23
24 #### The toplevel directory of the source tree. Fossil can be built
25 # in a directory that is separate from the source tree. Just change
26 # the following to point from the build directory to the src/ folder.
27 #
@@ -35,10 +35,14 @@
35 # will run on the platform that is doing the build. This is used
36 # to compile code-generator programs as part of the build process.
37 # See TCC below for the C compiler for building the finished binary.
38 #
39 BCC = gcc
 
 
 
 
40
41 #### Enable JSON (http://www.json.org) support using "cson"
42 #
43 # FOSSIL_ENABLE_JSON = 1
44
@@ -112,11 +116,18 @@
112 # will run on the target platform. This is usually the same
113 # as BCC, unless you are cross-compiling. This C compiler builds
114 # the finished binary for fossil. The BCC compiler above is used
115 # for building intermediate code-generator tools.
116 #
117 TCC = $(PREFIX)gcc -g -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
 
 
 
 
 
 
 
118
119 #### Compile resources for use in building executables that will run
120 # on the target platform.
121 #
122 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
123
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -13,15 +13,15 @@
13 #
14
15 #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
16 # By default, this is an empty string (i.e. use the native compiler).
17 #
18 PREFIX =
19 # PREFIX = mingw32-
20 # PREFIX = i686-pc-mingw32-
21 # PREFIX = i686-w64-mingw32-
22 # PREFIX = x86_64-w64-mingw32-
23
24 #### The toplevel directory of the source tree. Fossil can be built
25 # in a directory that is separate from the source tree. Just change
26 # the following to point from the build directory to the src/ folder.
27 #
@@ -35,10 +35,14 @@
35 # will run on the platform that is doing the build. This is used
36 # to compile code-generator programs as part of the build process.
37 # See TCC below for the C compiler for building the finished binary.
38 #
39 BCC = gcc
40
41 #### Enable compiling with debug symbols (much larger binary)
42 #
43 # FOSSIL_ENABLE_SYMBOLS = 1
44
45 #### Enable JSON (http://www.json.org) support using "cson"
46 #
47 # FOSSIL_ENABLE_JSON = 1
48
@@ -112,11 +116,18 @@
116 # will run on the target platform. This is usually the same
117 # as BCC, unless you are cross-compiling. This C compiler builds
118 # the finished binary for fossil. The BCC compiler above is used
119 # for building intermediate code-generator tools.
120 #
121 TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
122
123 #### Add the necessary command line options to build with debugging
124 # symbols, if enabled.
125 #
126 ifdef FOSSIL_ENABLE_SYMBOLS
127 TCC += -g
128 endif
129
130 #### Compile resources for use in building executables that will run
131 # on the target platform.
132 #
133 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
134

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button