Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Improvements to command-line argument glob expansion on windows. Globbing now works correctly when compiled with mingw-w64 and with msvc. It is mostly correct when compiled with mingw, but fails for some files with non-ascii names. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
8205c01cd4087c1972a4b8dba0e93c08 |
User & Date: | drh 2012-12-01 03:25:52 |
Context
2012-12-01
| ||
03:38 | Allow upper or lower case letters for the captcha code. Also, recognize "O" as a "0". Ticket [b142647bfa04a] ... (check-in: 7f56910f user: drh tags: trunk) | |
03:25 | Improvements to command-line argument glob expansion on windows. Globbing now works correctly when compiled with mingw-w64 and with msvc. It is mostly correct when compiled with mingw, but fails for some files with non-ascii names. ... (check-in: 8205c01c user: drh tags: trunk) | |
03:18 | Make sure the SQLite memory allocator is initialized before trying to use it to convert MBCS into UTF8. ... (Closed-Leaf check-in: cc09cda2 user: drh tags: cmdline-expansion) | |
02:57 | Do not allow the "fossil server" command to serve any static content file that contains ".fossil" anywhere in its name. This prevents repository files and/or their journals from being downloaded as static content. ... (check-in: e726c808 user: drh tags: trunk) | |
Changes
Changes to src/main.c.
︙ | ︙ | |||
342 343 344 345 346 347 348 | memset(&g.json, 0, sizeof(g.json)); #endif free(g.zErrMsg); if(g.db){ db_close(0); } } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | memset(&g.json, 0, sizeof(g.json)); #endif free(g.zErrMsg); if(g.db){ db_close(0); } } /* ** Convert all arguments from mbcs (or unicode) to UTF-8. Then ** search g.argv for arguments "--args FILENAME". If found, then ** (1) remove the two arguments from g.argv ** (2) Read the file FILENAME ** (3) Use the contents of FILE to replace the two removed arguments: |
︙ | ︙ | |||
480 481 482 483 484 485 486 | unsigned int nLine; /* Number of lines in the file*/ unsigned int i, j, k; /* Loop counters */ int n; /* Number of bytes in one line */ char *z; /* General use string pointer */ char **newArgv; /* New expanded g.argv under construction */ char const * zFileName; /* input file name */ FILE * zInFile; /* input FILE */ | | > | < < < | | > > > | | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | unsigned int nLine; /* Number of lines in the file*/ unsigned int i, j, k; /* Loop counters */ int n; /* Number of bytes in one line */ char *z; /* General use string pointer */ char **newArgv; /* New expanded g.argv under construction */ char const * zFileName; /* input file name */ FILE * zInFile; /* input FILE */ #if defined(_WIN32) WCHAR buf[MAX_PATH]; #endif g.argc = argc; g.argv = argv; sqlite3_initialize(); #if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) for(i=0; i<g.argc; i++) g.argv[i] = fossil_mbcs_to_utf8(g.argv[i]); #else for(i=0; i<g.argc; i++) g.argv[i] = fossil_filename_to_utf8(g.argv[i]); #endif #if defined(_WIN32) GetModuleFileNameW(NULL, buf, MAX_PATH); g.nameOfExe = fossil_filename_to_utf8(buf); #else g.nameOfExe = g.argv[0]; #endif for(i=1; i<g.argc-1; i++){ z = g.argv[i]; if( z[0]!='-' ) continue; z++; |
︙ | ︙ | |||
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | memset(zNewArgv, 0, sizeof(char*)*(argc+1)); for(i=0; i<argc; i++){ zNewArgv[i] = fossil_strdup(argv[i]); } return zNewArgv; } #endif /* ** This procedure runs first. */ int main(int argc, char **argv) { const char *zCmdName = "unknown"; int idx; int rc; sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); memset(&g, 0, sizeof(g)); | > > > > > > | 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | memset(zNewArgv, 0, sizeof(char*)*(argc+1)); for(i=0; i<argc; i++){ zNewArgv[i] = fossil_strdup(argv[i]); } return zNewArgv; } #endif /* ** This procedure runs first. */ #if defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE) int _dowildcard = -1; /* This turns on command-line globbing in MinGW-w64 */ int wmain(int argc, wchar_t **argv) #else int main(int argc, char **argv) #endif { const char *zCmdName = "unknown"; int idx; int rc; sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); memset(&g, 0, sizeof(g)); |
︙ | ︙ |
Changes to src/makemake.tcl.
︙ | ︙ | |||
502 503 504 505 506 507 508 509 510 511 512 513 514 515 | RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static # OpenSSL: Add the necessary libraries required, if enabled. ifdef FOSSIL_ENABLE_SSL LIB += -lssl -lcrypto -lgdi32 endif # Tcl: Add the necessary libraries required, if enabled. | > > > > > > | 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 | RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static ifeq ($(PREFIX),) TCC += -DBROKEN_MINGW_CMDLINE else LIB += -municode endif # OpenSSL: Add the necessary libraries required, if enabled. ifdef FOSSIL_ENABLE_SSL LIB += -lssl -lcrypto -lgdi32 endif # Tcl: Add the necessary libraries required, if enabled. |
︙ | ︙ | |||
969 970 971 972 973 974 975 | zlib: @echo Building zlib from "$(ZLIBDIR)"... @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib cd $(OX) | | | 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 | zlib: @echo Building zlib from "$(ZLIBDIR)"... @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib cd $(OX) link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts $(OX)\linkopts: $B\win\Makefile.msc} set redir {>} foreach s [lsort [concat $src {shell sqlite3 th th_lang}]] { writeln "\techo \$(OX)\\$s.obj $redir \$@" set redir {>>} } |
︙ | ︙ |
Changes to win/Makefile.mingw.
︙ | ︙ | |||
172 173 174 175 176 177 178 179 180 181 182 183 184 185 | RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static # OpenSSL: Add the necessary libraries required, if enabled. ifdef FOSSIL_ENABLE_SSL LIB += -lssl -lcrypto -lgdi32 endif # Tcl: Add the necessary libraries required, if enabled. | > > > > > > | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static ifeq ($(PREFIX),) TCC += -DBROKEN_MINGW_CMDLINE else LIB += -municode endif # OpenSSL: Add the necessary libraries required, if enabled. ifdef FOSSIL_ENABLE_SSL LIB += -lssl -lcrypto -lgdi32 endif # Tcl: Add the necessary libraries required, if enabled. |
︙ | ︙ |
Changes to win/Makefile.mingw.mistachkin.
︙ | ︙ | |||
11 12 13 14 15 16 17 | # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or # MinGW-w64. # #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. # By default, this is an empty string (i.e. use the native compiler). # | | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or # MinGW-w64. # #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. # By default, this is an empty string (i.e. use the native compiler). # # PREFIX = # PREFIX = mingw32- # PREFIX = i686-pc-mingw32- PREFIX = i686-w64-mingw32- # PREFIX = x86_64-w64-mingw32- #### The toplevel directory of the source tree. Fossil can be built # in a directory that is separate from the source tree. Just change # the following to point from the build directory to the src/ folder. # SRCDIR = src |
︙ | ︙ | |||
172 173 174 175 176 177 178 179 180 181 182 183 184 185 | RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static # OpenSSL: Add the necessary libraries required, if enabled. ifdef FOSSIL_ENABLE_SSL LIB += -lssl -lcrypto -lgdi32 endif # Tcl: Add the necessary libraries required, if enabled. | > > > > > > | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | RCC += -DFOSSIL_ENABLE_JSON=1 endif #### We add the -static option here so that we can build a static # executable that will run in a chroot jail. # LIB = -static ifeq ($(PREFIX),) TCC += -DBROKEN_MINGW_CMDLINE else LIB += -municode endif # OpenSSL: Add the necessary libraries required, if enabled. ifdef FOSSIL_ENABLE_SSL LIB += -lssl -lcrypto -lgdi32 endif # Tcl: Add the necessary libraries required, if enabled. |
︙ | ︙ |
Changes to win/Makefile.msc.
︙ | ︙ | |||
252 253 254 255 256 257 258 | zlib: @echo Building zlib from "$(ZLIBDIR)"... @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib cd $(OX) | | | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | zlib: @echo Building zlib from "$(ZLIBDIR)"... @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib cd $(OX) link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts $(OX)\linkopts: $B\win\Makefile.msc echo $(OX)\add.obj > $@ echo $(OX)\allrepo.obj >> $@ echo $(OX)\attach.obj >> $@ echo $(OX)\bag.obj >> $@ echo $(OX)\bisect.obj >> $@ |
︙ | ︙ |