Fossil SCM

merged in trunk [4b0f813b8c].

stephan 2011-10-07 02:16 UTC json-multitag-test merge
Commit 39d9f83781d1ed699107a57683a259679665aa7a
--- src/configure.c
+++ src/configure.c
@@ -785,10 +785,11 @@
785785
const char *zMethod;
786786
if( g.argc<3 ){
787787
usage("export|import|merge|pull|reset ...");
788788
}
789789
db_find_and_open_repository(0, 0);
790
+ db_open_config(0);
790791
zMethod = g.argv[2];
791792
n = strlen(zMethod);
792793
if( strncmp(zMethod, "export", n)==0 ){
793794
int mask;
794795
const char *zSince = find_option("since",0,1);
795796
--- src/configure.c
+++ src/configure.c
@@ -785,10 +785,11 @@
785 const char *zMethod;
786 if( g.argc<3 ){
787 usage("export|import|merge|pull|reset ...");
788 }
789 db_find_and_open_repository(0, 0);
 
790 zMethod = g.argv[2];
791 n = strlen(zMethod);
792 if( strncmp(zMethod, "export", n)==0 ){
793 int mask;
794 const char *zSince = find_option("since",0,1);
795
--- src/configure.c
+++ src/configure.c
@@ -785,10 +785,11 @@
785 const char *zMethod;
786 if( g.argc<3 ){
787 usage("export|import|merge|pull|reset ...");
788 }
789 db_find_and_open_repository(0, 0);
790 db_open_config(0);
791 zMethod = g.argv[2];
792 n = strlen(zMethod);
793 if( strncmp(zMethod, "export", n)==0 ){
794 int mask;
795 const char *zSince = find_option("since",0,1);
796
+1 -1
--- src/file.c
+++ src/file.c
@@ -34,11 +34,11 @@
3434
** The file status information from the most recent stat() call.
3535
**
3636
** Use _stati64 rather than stat on windows, in order to handle files
3737
** larger than 2GB.
3838
*/
39
-#if defined(_WIN32) && defined(__MSVCRT__)
39
+#if defined(_WIN32) && (defined(__MSVCRT__) || defined(_MSC_VER))
4040
# define stat _stati64
4141
#endif
4242
/*
4343
** On Windows S_ISLNK always returns FALSE.
4444
*/
4545
--- src/file.c
+++ src/file.c
@@ -34,11 +34,11 @@
34 ** The file status information from the most recent stat() call.
35 **
36 ** Use _stati64 rather than stat on windows, in order to handle files
37 ** larger than 2GB.
38 */
39 #if defined(_WIN32) && defined(__MSVCRT__)
40 # define stat _stati64
41 #endif
42 /*
43 ** On Windows S_ISLNK always returns FALSE.
44 */
45
--- src/file.c
+++ src/file.c
@@ -34,11 +34,11 @@
34 ** The file status information from the most recent stat() call.
35 **
36 ** Use _stati64 rather than stat on windows, in order to handle files
37 ** larger than 2GB.
38 */
39 #if defined(_WIN32) && (defined(__MSVCRT__) || defined(_MSC_VER))
40 # define stat _stati64
41 #endif
42 /*
43 ** On Windows S_ISLNK always returns FALSE.
44 */
45
+19 -2
--- src/main.c
+++ src/main.c
@@ -320,11 +320,12 @@
320320
unsigned int nLine; /* Number of lines in the file*/
321321
unsigned int i, j, k; /* Loop counters */
322322
int n; /* Number of bytes in one line */
323323
char *z; /* General use string pointer */
324324
char **newArgv; /* New expanded g.argv under construction */
325
-
325
+ char const * zFileName; /* input file name */
326
+ FILE * zInFile; /* input FILE */
326327
for(i=1; i<g.argc-1; i++){
327328
z = g.argv[i];
328329
if( z[0]!='-' ) continue;
329330
z++;
330331
if( z[0]=='-' ) z++;
@@ -331,11 +332,23 @@
331332
if( z[0]==0 ) return; /* Stop searching at "--" */
332333
if( fossil_strcmp(z, "args")==0 ) break;
333334
}
334335
if( i>=g.argc-1 ) return;
335336
336
- blob_read_from_file(&file, g.argv[i+1]);
337
+ zFileName = g.argv[i+1];
338
+ zInFile = (0==strcmp("-",zFileName))
339
+ ? stdin
340
+ : fopen(zFileName,"rb");
341
+ if(!zInFile){
342
+ fossil_panic("Cannot open -args file [%s]", zFileName);
343
+ }else{
344
+ blob_read_from_channel(&file, zInFile, -1);
345
+ if(stdin != zInFile){
346
+ fclose(zInFile);
347
+ }
348
+ zInFile = NULL;
349
+ }
337350
z = blob_str(&file);
338351
for(k=0, nLine=1; z[k]; k++) if( z[k]=='\n' ) nLine++;
339352
newArgv = fossil_malloc( sizeof(char*)*(g.argc + nLine*2) );
340353
for(j=0; j<i; j++) newArgv[j] = g.argv[j];
341354
@@ -342,10 +355,14 @@
342355
blob_rewind(&file);
343356
while( (n = blob_line(&file, &line))>0 ){
344357
if( n<=1 ) continue;
345358
z = blob_buffer(&line);
346359
z[n-1] = 0;
360
+ if((n>1) && ('\r'==z[n-2])){
361
+ if(n==2) continue /*empty line*/;
362
+ z[n-2] = 0;
363
+ }
347364
newArgv[j++] = z;
348365
if( z[0]=='-' ){
349366
for(k=1; z[k] && !fossil_isspace(z[k]); k++){}
350367
if( z[k] ){
351368
z[k] = 0;
352369
--- src/main.c
+++ src/main.c
@@ -320,11 +320,12 @@
320 unsigned int nLine; /* Number of lines in the file*/
321 unsigned int i, j, k; /* Loop counters */
322 int n; /* Number of bytes in one line */
323 char *z; /* General use string pointer */
324 char **newArgv; /* New expanded g.argv under construction */
325
 
326 for(i=1; i<g.argc-1; i++){
327 z = g.argv[i];
328 if( z[0]!='-' ) continue;
329 z++;
330 if( z[0]=='-' ) z++;
@@ -331,11 +332,23 @@
331 if( z[0]==0 ) return; /* Stop searching at "--" */
332 if( fossil_strcmp(z, "args")==0 ) break;
333 }
334 if( i>=g.argc-1 ) return;
335
336 blob_read_from_file(&file, g.argv[i+1]);
 
 
 
 
 
 
 
 
 
 
 
 
337 z = blob_str(&file);
338 for(k=0, nLine=1; z[k]; k++) if( z[k]=='\n' ) nLine++;
339 newArgv = fossil_malloc( sizeof(char*)*(g.argc + nLine*2) );
340 for(j=0; j<i; j++) newArgv[j] = g.argv[j];
341
@@ -342,10 +355,14 @@
342 blob_rewind(&file);
343 while( (n = blob_line(&file, &line))>0 ){
344 if( n<=1 ) continue;
345 z = blob_buffer(&line);
346 z[n-1] = 0;
 
 
 
 
347 newArgv[j++] = z;
348 if( z[0]=='-' ){
349 for(k=1; z[k] && !fossil_isspace(z[k]); k++){}
350 if( z[k] ){
351 z[k] = 0;
352
--- src/main.c
+++ src/main.c
@@ -320,11 +320,12 @@
320 unsigned int nLine; /* Number of lines in the file*/
321 unsigned int i, j, k; /* Loop counters */
322 int n; /* Number of bytes in one line */
323 char *z; /* General use string pointer */
324 char **newArgv; /* New expanded g.argv under construction */
325 char const * zFileName; /* input file name */
326 FILE * zInFile; /* input FILE */
327 for(i=1; i<g.argc-1; i++){
328 z = g.argv[i];
329 if( z[0]!='-' ) continue;
330 z++;
331 if( z[0]=='-' ) z++;
@@ -331,11 +332,23 @@
332 if( z[0]==0 ) return; /* Stop searching at "--" */
333 if( fossil_strcmp(z, "args")==0 ) break;
334 }
335 if( i>=g.argc-1 ) return;
336
337 zFileName = g.argv[i+1];
338 zInFile = (0==strcmp("-",zFileName))
339 ? stdin
340 : fopen(zFileName,"rb");
341 if(!zInFile){
342 fossil_panic("Cannot open -args file [%s]", zFileName);
343 }else{
344 blob_read_from_channel(&file, zInFile, -1);
345 if(stdin != zInFile){
346 fclose(zInFile);
347 }
348 zInFile = NULL;
349 }
350 z = blob_str(&file);
351 for(k=0, nLine=1; z[k]; k++) if( z[k]=='\n' ) nLine++;
352 newArgv = fossil_malloc( sizeof(char*)*(g.argc + nLine*2) );
353 for(j=0; j<i; j++) newArgv[j] = g.argv[j];
354
@@ -342,10 +355,14 @@
355 blob_rewind(&file);
356 while( (n = blob_line(&file, &line))>0 ){
357 if( n<=1 ) continue;
358 z = blob_buffer(&line);
359 z[n-1] = 0;
360 if((n>1) && ('\r'==z[n-2])){
361 if(n==2) continue /*empty line*/;
362 z[n-2] = 0;
363 }
364 newArgv[j++] = z;
365 if( z[0]=='-' ){
366 for(k=1; z[k] && !fossil_isspace(z[k]); k++){}
367 if( z[k] ){
368 z[k] = 0;
369
+19 -2
--- src/main.c
+++ src/main.c
@@ -320,11 +320,12 @@
320320
unsigned int nLine; /* Number of lines in the file*/
321321
unsigned int i, j, k; /* Loop counters */
322322
int n; /* Number of bytes in one line */
323323
char *z; /* General use string pointer */
324324
char **newArgv; /* New expanded g.argv under construction */
325
-
325
+ char const * zFileName; /* input file name */
326
+ FILE * zInFile; /* input FILE */
326327
for(i=1; i<g.argc-1; i++){
327328
z = g.argv[i];
328329
if( z[0]!='-' ) continue;
329330
z++;
330331
if( z[0]=='-' ) z++;
@@ -331,11 +332,23 @@
331332
if( z[0]==0 ) return; /* Stop searching at "--" */
332333
if( fossil_strcmp(z, "args")==0 ) break;
333334
}
334335
if( i>=g.argc-1 ) return;
335336
336
- blob_read_from_file(&file, g.argv[i+1]);
337
+ zFileName = g.argv[i+1];
338
+ zInFile = (0==strcmp("-",zFileName))
339
+ ? stdin
340
+ : fopen(zFileName,"rb");
341
+ if(!zInFile){
342
+ fossil_panic("Cannot open -args file [%s]", zFileName);
343
+ }else{
344
+ blob_read_from_channel(&file, zInFile, -1);
345
+ if(stdin != zInFile){
346
+ fclose(zInFile);
347
+ }
348
+ zInFile = NULL;
349
+ }
337350
z = blob_str(&file);
338351
for(k=0, nLine=1; z[k]; k++) if( z[k]=='\n' ) nLine++;
339352
newArgv = fossil_malloc( sizeof(char*)*(g.argc + nLine*2) );
340353
for(j=0; j<i; j++) newArgv[j] = g.argv[j];
341354
@@ -342,10 +355,14 @@
342355
blob_rewind(&file);
343356
while( (n = blob_line(&file, &line))>0 ){
344357
if( n<=1 ) continue;
345358
z = blob_buffer(&line);
346359
z[n-1] = 0;
360
+ if((n>1) && ('\r'==z[n-2])){
361
+ if(n==2) continue /*empty line*/;
362
+ z[n-2] = 0;
363
+ }
347364
newArgv[j++] = z;
348365
if( z[0]=='-' ){
349366
for(k=1; z[k] && !fossil_isspace(z[k]); k++){}
350367
if( z[k] ){
351368
z[k] = 0;
352369
--- src/main.c
+++ src/main.c
@@ -320,11 +320,12 @@
320 unsigned int nLine; /* Number of lines in the file*/
321 unsigned int i, j, k; /* Loop counters */
322 int n; /* Number of bytes in one line */
323 char *z; /* General use string pointer */
324 char **newArgv; /* New expanded g.argv under construction */
325
 
326 for(i=1; i<g.argc-1; i++){
327 z = g.argv[i];
328 if( z[0]!='-' ) continue;
329 z++;
330 if( z[0]=='-' ) z++;
@@ -331,11 +332,23 @@
331 if( z[0]==0 ) return; /* Stop searching at "--" */
332 if( fossil_strcmp(z, "args")==0 ) break;
333 }
334 if( i>=g.argc-1 ) return;
335
336 blob_read_from_file(&file, g.argv[i+1]);
 
 
 
 
 
 
 
 
 
 
 
 
337 z = blob_str(&file);
338 for(k=0, nLine=1; z[k]; k++) if( z[k]=='\n' ) nLine++;
339 newArgv = fossil_malloc( sizeof(char*)*(g.argc + nLine*2) );
340 for(j=0; j<i; j++) newArgv[j] = g.argv[j];
341
@@ -342,10 +355,14 @@
342 blob_rewind(&file);
343 while( (n = blob_line(&file, &line))>0 ){
344 if( n<=1 ) continue;
345 z = blob_buffer(&line);
346 z[n-1] = 0;
 
 
 
 
347 newArgv[j++] = z;
348 if( z[0]=='-' ){
349 for(k=1; z[k] && !fossil_isspace(z[k]); k++){}
350 if( z[k] ){
351 z[k] = 0;
352
--- src/main.c
+++ src/main.c
@@ -320,11 +320,12 @@
320 unsigned int nLine; /* Number of lines in the file*/
321 unsigned int i, j, k; /* Loop counters */
322 int n; /* Number of bytes in one line */
323 char *z; /* General use string pointer */
324 char **newArgv; /* New expanded g.argv under construction */
325 char const * zFileName; /* input file name */
326 FILE * zInFile; /* input FILE */
327 for(i=1; i<g.argc-1; i++){
328 z = g.argv[i];
329 if( z[0]!='-' ) continue;
330 z++;
331 if( z[0]=='-' ) z++;
@@ -331,11 +332,23 @@
332 if( z[0]==0 ) return; /* Stop searching at "--" */
333 if( fossil_strcmp(z, "args")==0 ) break;
334 }
335 if( i>=g.argc-1 ) return;
336
337 zFileName = g.argv[i+1];
338 zInFile = (0==strcmp("-",zFileName))
339 ? stdin
340 : fopen(zFileName,"rb");
341 if(!zInFile){
342 fossil_panic("Cannot open -args file [%s]", zFileName);
343 }else{
344 blob_read_from_channel(&file, zInFile, -1);
345 if(stdin != zInFile){
346 fclose(zInFile);
347 }
348 zInFile = NULL;
349 }
350 z = blob_str(&file);
351 for(k=0, nLine=1; z[k]; k++) if( z[k]=='\n' ) nLine++;
352 newArgv = fossil_malloc( sizeof(char*)*(g.argc + nLine*2) );
353 for(j=0; j<i; j++) newArgv[j] = g.argv[j];
354
@@ -342,10 +355,14 @@
355 blob_rewind(&file);
356 while( (n = blob_line(&file, &line))>0 ){
357 if( n<=1 ) continue;
358 z = blob_buffer(&line);
359 z[n-1] = 0;
360 if((n>1) && ('\r'==z[n-2])){
361 if(n==2) continue /*empty line*/;
362 z[n-2] = 0;
363 }
364 newArgv[j++] = z;
365 if( z[0]=='-' ){
366 for(k=1; z[k] && !fossil_isspace(z[k]); k++){}
367 if( z[k] ){
368 z[k] = 0;
369

Keyboard Shortcuts

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