Fossil SCM
Remove unnecessary end-of-line spacing
Commit
fc3d9f52ee54e29293046c530fbe697edbdced48
Parent
7ab03289eeeb94d…
6 files changed
+1
-1
+3
-3
+1
-1
+1
-1
+3
-3
+6
-6
+1
-1
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -1002,11 +1002,11 @@ | ||
| 1002 | 1002 | |
| 1003 | 1003 | /* |
| 1004 | 1004 | ** WEBPAGE: fileage |
| 1005 | 1005 | ** |
| 1006 | 1006 | ** Show all files in a single check-in (identified by the name= query |
| 1007 | -** parameter) in order of increasing age. | |
| 1007 | +** parameter) in order of increasing age. | |
| 1008 | 1008 | ** |
| 1009 | 1009 | ** Parameters: |
| 1010 | 1010 | ** name=VERSION Selects the check-in version (default=tip). |
| 1011 | 1011 | ** glob=STRING Only shows files matching this glob pattern |
| 1012 | 1012 | ** (e.g. *.c or *.txt). |
| 1013 | 1013 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -1002,11 +1002,11 @@ | |
| 1002 | |
| 1003 | /* |
| 1004 | ** WEBPAGE: fileage |
| 1005 | ** |
| 1006 | ** Show all files in a single check-in (identified by the name= query |
| 1007 | ** parameter) in order of increasing age. |
| 1008 | ** |
| 1009 | ** Parameters: |
| 1010 | ** name=VERSION Selects the check-in version (default=tip). |
| 1011 | ** glob=STRING Only shows files matching this glob pattern |
| 1012 | ** (e.g. *.c or *.txt). |
| 1013 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -1002,11 +1002,11 @@ | |
| 1002 | |
| 1003 | /* |
| 1004 | ** WEBPAGE: fileage |
| 1005 | ** |
| 1006 | ** Show all files in a single check-in (identified by the name= query |
| 1007 | ** parameter) in order of increasing age. |
| 1008 | ** |
| 1009 | ** Parameters: |
| 1010 | ** name=VERSION Selects the check-in version (default=tip). |
| 1011 | ** glob=STRING Only shows files matching this glob pattern |
| 1012 | ** (e.g. *.c or *.txt). |
| 1013 |
+3
-3
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -273,11 +273,11 @@ | ||
| 273 | 273 | ** Take care of -r version of ls command |
| 274 | 274 | */ |
| 275 | 275 | static void ls_cmd_rev( |
| 276 | 276 | const char *zRev, /* Revision string given */ |
| 277 | 277 | int verboseFlag, /* Verbose flag given */ |
| 278 | - int showAge, /* Age flag given */ | |
| 278 | + int showAge, /* Age flag given */ | |
| 279 | 279 | int timeOrder /* Order by time flag given */ |
| 280 | 280 | ){ |
| 281 | 281 | Stmt q; |
| 282 | 282 | char *zOrderBy = "pathname COLLATE nocase"; |
| 283 | 283 | char *zName; |
| @@ -309,11 +309,11 @@ | ||
| 309 | 309 | |
| 310 | 310 | rid = symbolic_name_to_rid(zRev, "ci"); |
| 311 | 311 | if( rid==0 ){ |
| 312 | 312 | fossil_fatal("not a valid check-in: %s", zRev); |
| 313 | 313 | } |
| 314 | - | |
| 314 | + | |
| 315 | 315 | if( timeOrder ){ |
| 316 | 316 | zOrderBy = "mtime DESC"; |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | compute_fileage(rid,0); |
| @@ -334,11 +334,11 @@ | ||
| 334 | 334 | fossil_print("%s %7d %s\n", zTime, size, zFile); |
| 335 | 335 | }else if( showAge ){ |
| 336 | 336 | fossil_print("%s %s\n", zTime, zFile); |
| 337 | 337 | }else{ |
| 338 | 338 | fossil_print("%s\n", zFile); |
| 339 | - } | |
| 339 | + } | |
| 340 | 340 | } |
| 341 | 341 | db_finalize(&q); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /* |
| 345 | 345 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -273,11 +273,11 @@ | |
| 273 | ** Take care of -r version of ls command |
| 274 | */ |
| 275 | static void ls_cmd_rev( |
| 276 | const char *zRev, /* Revision string given */ |
| 277 | int verboseFlag, /* Verbose flag given */ |
| 278 | int showAge, /* Age flag given */ |
| 279 | int timeOrder /* Order by time flag given */ |
| 280 | ){ |
| 281 | Stmt q; |
| 282 | char *zOrderBy = "pathname COLLATE nocase"; |
| 283 | char *zName; |
| @@ -309,11 +309,11 @@ | |
| 309 | |
| 310 | rid = symbolic_name_to_rid(zRev, "ci"); |
| 311 | if( rid==0 ){ |
| 312 | fossil_fatal("not a valid check-in: %s", zRev); |
| 313 | } |
| 314 | |
| 315 | if( timeOrder ){ |
| 316 | zOrderBy = "mtime DESC"; |
| 317 | } |
| 318 | |
| 319 | compute_fileage(rid,0); |
| @@ -334,11 +334,11 @@ | |
| 334 | fossil_print("%s %7d %s\n", zTime, size, zFile); |
| 335 | }else if( showAge ){ |
| 336 | fossil_print("%s %s\n", zTime, zFile); |
| 337 | }else{ |
| 338 | fossil_print("%s\n", zFile); |
| 339 | } |
| 340 | } |
| 341 | db_finalize(&q); |
| 342 | } |
| 343 | |
| 344 | /* |
| 345 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -273,11 +273,11 @@ | |
| 273 | ** Take care of -r version of ls command |
| 274 | */ |
| 275 | static void ls_cmd_rev( |
| 276 | const char *zRev, /* Revision string given */ |
| 277 | int verboseFlag, /* Verbose flag given */ |
| 278 | int showAge, /* Age flag given */ |
| 279 | int timeOrder /* Order by time flag given */ |
| 280 | ){ |
| 281 | Stmt q; |
| 282 | char *zOrderBy = "pathname COLLATE nocase"; |
| 283 | char *zName; |
| @@ -309,11 +309,11 @@ | |
| 309 | |
| 310 | rid = symbolic_name_to_rid(zRev, "ci"); |
| 311 | if( rid==0 ){ |
| 312 | fossil_fatal("not a valid check-in: %s", zRev); |
| 313 | } |
| 314 | |
| 315 | if( timeOrder ){ |
| 316 | zOrderBy = "mtime DESC"; |
| 317 | } |
| 318 | |
| 319 | compute_fileage(rid,0); |
| @@ -334,11 +334,11 @@ | |
| 334 | fossil_print("%s %7d %s\n", zTime, size, zFile); |
| 335 | }else if( showAge ){ |
| 336 | fossil_print("%s %s\n", zTime, zFile); |
| 337 | }else{ |
| 338 | fossil_print("%s\n", zFile); |
| 339 | } |
| 340 | } |
| 341 | db_finalize(&q); |
| 342 | } |
| 343 | |
| 344 | /* |
| 345 |
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -393,11 +393,11 @@ | ||
| 393 | 393 | |
| 394 | 394 | if( recomputeFlag ) leaf_rebuild(); |
| 395 | 395 | blob_zero(&sql); |
| 396 | 396 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 397 | 397 | if( !multipleFlag ){ |
| 398 | - /* The usual case - show all leaves */ | |
| 398 | + /* The usual case - show all leaves */ | |
| 399 | 399 | blob_append_sql(&sql, " AND blob.rid IN leaf"); |
| 400 | 400 | }else{ |
| 401 | 401 | /* Show only leaves where two are more occur in the same branch */ |
| 402 | 402 | db_multi_exec( |
| 403 | 403 | "CREATE TEMP TABLE openLeaf(rid INTEGER PRIMARY KEY);" |
| 404 | 404 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -393,11 +393,11 @@ | |
| 393 | |
| 394 | if( recomputeFlag ) leaf_rebuild(); |
| 395 | blob_zero(&sql); |
| 396 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 397 | if( !multipleFlag ){ |
| 398 | /* The usual case - show all leaves */ |
| 399 | blob_append_sql(&sql, " AND blob.rid IN leaf"); |
| 400 | }else{ |
| 401 | /* Show only leaves where two are more occur in the same branch */ |
| 402 | db_multi_exec( |
| 403 | "CREATE TEMP TABLE openLeaf(rid INTEGER PRIMARY KEY);" |
| 404 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -393,11 +393,11 @@ | |
| 393 | |
| 394 | if( recomputeFlag ) leaf_rebuild(); |
| 395 | blob_zero(&sql); |
| 396 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 397 | if( !multipleFlag ){ |
| 398 | /* The usual case - show all leaves */ |
| 399 | blob_append_sql(&sql, " AND blob.rid IN leaf"); |
| 400 | }else{ |
| 401 | /* Show only leaves where two are more occur in the same branch */ |
| 402 | db_multi_exec( |
| 403 | "CREATE TEMP TABLE openLeaf(rid INTEGER PRIMARY KEY);" |
| 404 |
+1
-1
| --- src/leaf.c | ||
| +++ src/leaf.c | ||
| @@ -194,11 +194,11 @@ | ||
| 194 | 194 | int rc; /* Result */ |
| 195 | 195 | char zVal[30]; |
| 196 | 196 | if( !is_a_leaf(rid) ) return 0; |
| 197 | 197 | sqlite3_snprintf(sizeof(zVal), zVal, "%d", rid); |
| 198 | 198 | rc = db_exists( |
| 199 | - "SELECT 1 FROM leaf" | |
| 199 | + "SELECT 1 FROM leaf" | |
| 200 | 200 | " WHERE NOT %z" |
| 201 | 201 | " AND rid<>%d" |
| 202 | 202 | " AND (SELECT value FROM tagxref WHERE tagid=%d AND rid=leaf.rid)=" |
| 203 | 203 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)" |
| 204 | 204 | " AND NOT %z", |
| 205 | 205 |
| --- src/leaf.c | |
| +++ src/leaf.c | |
| @@ -194,11 +194,11 @@ | |
| 194 | int rc; /* Result */ |
| 195 | char zVal[30]; |
| 196 | if( !is_a_leaf(rid) ) return 0; |
| 197 | sqlite3_snprintf(sizeof(zVal), zVal, "%d", rid); |
| 198 | rc = db_exists( |
| 199 | "SELECT 1 FROM leaf" |
| 200 | " WHERE NOT %z" |
| 201 | " AND rid<>%d" |
| 202 | " AND (SELECT value FROM tagxref WHERE tagid=%d AND rid=leaf.rid)=" |
| 203 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)" |
| 204 | " AND NOT %z", |
| 205 |
| --- src/leaf.c | |
| +++ src/leaf.c | |
| @@ -194,11 +194,11 @@ | |
| 194 | int rc; /* Result */ |
| 195 | char zVal[30]; |
| 196 | if( !is_a_leaf(rid) ) return 0; |
| 197 | sqlite3_snprintf(sizeof(zVal), zVal, "%d", rid); |
| 198 | rc = db_exists( |
| 199 | "SELECT 1 FROM leaf" |
| 200 | " WHERE NOT %z" |
| 201 | " AND rid<>%d" |
| 202 | " AND (SELECT value FROM tagxref WHERE tagid=%d AND rid=leaf.rid)=" |
| 203 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)" |
| 204 | " AND NOT %z", |
| 205 |
+3
-3
| --- src/pivot.c | ||
| +++ src/pivot.c | ||
| @@ -48,11 +48,11 @@ | ||
| 48 | 48 | "DELETE FROM aqueue;" |
| 49 | 49 | "CREATE INDEX IF NOT EXISTS aqueue_idx1 ON aqueue(pending, mtime);" |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | 52 | /* Insert the primary record */ |
| 53 | - db_multi_exec( | |
| 53 | + db_multi_exec( | |
| 54 | 54 | "INSERT INTO aqueue(rid, mtime, pending, src)" |
| 55 | 55 | " SELECT %d, mtime, 1, 1 FROM event WHERE objid=%d AND type='ci' LIMIT 1", |
| 56 | 56 | rid, rid |
| 57 | 57 | ); |
| 58 | 58 | } |
| @@ -62,11 +62,11 @@ | ||
| 62 | 62 | ** must be at least one secondary but there can be more than one if |
| 63 | 63 | ** desired. |
| 64 | 64 | */ |
| 65 | 65 | void pivot_set_secondary(int rid){ |
| 66 | 66 | /* Insert the primary record */ |
| 67 | - db_multi_exec( | |
| 67 | + db_multi_exec( | |
| 68 | 68 | "INSERT OR IGNORE INTO aqueue(rid, mtime, pending, src)" |
| 69 | 69 | " SELECT %d, mtime, 1, 0 FROM event WHERE objid=%d AND type='ci'", |
| 70 | 70 | rid, rid |
| 71 | 71 | ); |
| 72 | 72 | } |
| @@ -77,11 +77,11 @@ | ||
| 77 | 77 | ** can be found. |
| 78 | 78 | */ |
| 79 | 79 | int pivot_find(void){ |
| 80 | 80 | Stmt q1, q2, u1, i1; |
| 81 | 81 | int rid = 0; |
| 82 | - | |
| 82 | + | |
| 83 | 83 | /* aqueue must contain at least one primary and one other. Otherwise |
| 84 | 84 | ** we abort early |
| 85 | 85 | */ |
| 86 | 86 | if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){ |
| 87 | 87 | fossil_fatal("lack both primary and secondary files"); |
| 88 | 88 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -48,11 +48,11 @@ | |
| 48 | "DELETE FROM aqueue;" |
| 49 | "CREATE INDEX IF NOT EXISTS aqueue_idx1 ON aqueue(pending, mtime);" |
| 50 | ); |
| 51 | |
| 52 | /* Insert the primary record */ |
| 53 | db_multi_exec( |
| 54 | "INSERT INTO aqueue(rid, mtime, pending, src)" |
| 55 | " SELECT %d, mtime, 1, 1 FROM event WHERE objid=%d AND type='ci' LIMIT 1", |
| 56 | rid, rid |
| 57 | ); |
| 58 | } |
| @@ -62,11 +62,11 @@ | |
| 62 | ** must be at least one secondary but there can be more than one if |
| 63 | ** desired. |
| 64 | */ |
| 65 | void pivot_set_secondary(int rid){ |
| 66 | /* Insert the primary record */ |
| 67 | db_multi_exec( |
| 68 | "INSERT OR IGNORE INTO aqueue(rid, mtime, pending, src)" |
| 69 | " SELECT %d, mtime, 1, 0 FROM event WHERE objid=%d AND type='ci'", |
| 70 | rid, rid |
| 71 | ); |
| 72 | } |
| @@ -77,11 +77,11 @@ | |
| 77 | ** can be found. |
| 78 | */ |
| 79 | int pivot_find(void){ |
| 80 | Stmt q1, q2, u1, i1; |
| 81 | int rid = 0; |
| 82 | |
| 83 | /* aqueue must contain at least one primary and one other. Otherwise |
| 84 | ** we abort early |
| 85 | */ |
| 86 | if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){ |
| 87 | fossil_fatal("lack both primary and secondary files"); |
| 88 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -48,11 +48,11 @@ | |
| 48 | "DELETE FROM aqueue;" |
| 49 | "CREATE INDEX IF NOT EXISTS aqueue_idx1 ON aqueue(pending, mtime);" |
| 50 | ); |
| 51 | |
| 52 | /* Insert the primary record */ |
| 53 | db_multi_exec( |
| 54 | "INSERT INTO aqueue(rid, mtime, pending, src)" |
| 55 | " SELECT %d, mtime, 1, 1 FROM event WHERE objid=%d AND type='ci' LIMIT 1", |
| 56 | rid, rid |
| 57 | ); |
| 58 | } |
| @@ -62,11 +62,11 @@ | |
| 62 | ** must be at least one secondary but there can be more than one if |
| 63 | ** desired. |
| 64 | */ |
| 65 | void pivot_set_secondary(int rid){ |
| 66 | /* Insert the primary record */ |
| 67 | db_multi_exec( |
| 68 | "INSERT OR IGNORE INTO aqueue(rid, mtime, pending, src)" |
| 69 | " SELECT %d, mtime, 1, 0 FROM event WHERE objid=%d AND type='ci'", |
| 70 | rid, rid |
| 71 | ); |
| 72 | } |
| @@ -77,11 +77,11 @@ | |
| 77 | ** can be found. |
| 78 | */ |
| 79 | int pivot_find(void){ |
| 80 | Stmt q1, q2, u1, i1; |
| 81 | int rid = 0; |
| 82 | |
| 83 | /* aqueue must contain at least one primary and one other. Otherwise |
| 84 | ** we abort early |
| 85 | */ |
| 86 | if( db_int(0, "SELECT count(distinct src) FROM aqueue")<2 ){ |
| 87 | fossil_fatal("lack both primary and secondary files"); |
| 88 |
+6
-6
| --- src/popen.c | ||
| +++ src/popen.c | ||
| @@ -38,11 +38,11 @@ | ||
| 38 | 38 | ** The following macros are used to cast pointers to integers and |
| 39 | 39 | ** integers to pointers. The way you do this varies from one compiler |
| 40 | 40 | ** to the next, so we have developed the following set of #if statements |
| 41 | 41 | ** to generate appropriate macros for a wide range of compilers. |
| 42 | 42 | ** |
| 43 | -** The correct "ANSI" way to do this is to use the intptr_t type. | |
| 43 | +** The correct "ANSI" way to do this is to use the intptr_t type. | |
| 44 | 44 | ** Unfortunately, that typedef is not available on all compilers, or |
| 45 | 45 | ** if it is available, it requires an #include of specific headers |
| 46 | 46 | ** that vary from one machine to the next. |
| 47 | 47 | ** |
| 48 | 48 | ** This code is copied out of SQLite. |
| @@ -112,11 +112,11 @@ | ||
| 112 | 112 | } |
| 113 | 113 | #endif |
| 114 | 114 | |
| 115 | 115 | /* |
| 116 | 116 | ** Create a child process running shell command "zCmd". *ppOut is |
| 117 | -** a FILE that becomes the standard input of the child process. | |
| 117 | +** a FILE that becomes the standard input of the child process. | |
| 118 | 118 | ** (The caller writes to *ppOut in order to send text to the child.) |
| 119 | 119 | ** *ppIn is stdout from the child process. (The caller |
| 120 | 120 | ** reads from *ppIn in order to receive input from the child.) |
| 121 | 121 | ** Note that *ppIn is an unbuffered file descriptor, not a FILE. |
| 122 | 122 | ** The process ID of the child is written into *pChildPid. |
| @@ -124,17 +124,17 @@ | ||
| 124 | 124 | ** Return the number of errors. |
| 125 | 125 | */ |
| 126 | 126 | int popen2(const char *zCmd, int *pfdIn, FILE **ppOut, int *pChildPid){ |
| 127 | 127 | #ifdef _WIN32 |
| 128 | 128 | HANDLE hStdinRd, hStdinWr, hStdoutRd, hStdoutWr, hStderr; |
| 129 | - SECURITY_ATTRIBUTES saAttr; | |
| 129 | + SECURITY_ATTRIBUTES saAttr; | |
| 130 | 130 | DWORD childPid = 0; |
| 131 | 131 | int fd; |
| 132 | 132 | |
| 133 | 133 | saAttr.nLength = sizeof(saAttr); |
| 134 | 134 | saAttr.bInheritHandle = TRUE; |
| 135 | - saAttr.lpSecurityDescriptor = NULL; | |
| 135 | + saAttr.lpSecurityDescriptor = NULL; | |
| 136 | 136 | hStderr = GetStdHandle(STD_ERROR_HANDLE); |
| 137 | 137 | if( !CreatePipe(&hStdoutRd, &hStdoutWr, &saAttr, 4096) ){ |
| 138 | 138 | win32_fatal_error("cannot create pipe for stdout"); |
| 139 | 139 | } |
| 140 | 140 | SetHandleInformation( hStdoutRd, HANDLE_FLAG_INHERIT, FALSE); |
| @@ -141,18 +141,18 @@ | ||
| 141 | 141 | |
| 142 | 142 | if( !CreatePipe(&hStdinRd, &hStdinWr, &saAttr, 4096) ){ |
| 143 | 143 | win32_fatal_error("cannot create pipe for stdin"); |
| 144 | 144 | } |
| 145 | 145 | SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE); |
| 146 | - | |
| 146 | + | |
| 147 | 147 | win32_create_child_process(fossil_utf8_to_unicode(zCmd), |
| 148 | 148 | hStdinRd, hStdoutWr, hStderr,&childPid); |
| 149 | 149 | *pChildPid = childPid; |
| 150 | 150 | *pfdIn = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0); |
| 151 | 151 | fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0); |
| 152 | 152 | *ppOut = _fdopen(fd, "w"); |
| 153 | - CloseHandle(hStdinRd); | |
| 153 | + CloseHandle(hStdinRd); | |
| 154 | 154 | CloseHandle(hStdoutWr); |
| 155 | 155 | return 0; |
| 156 | 156 | #else |
| 157 | 157 | int pin[2], pout[2]; |
| 158 | 158 | *pfdIn = 0; |
| 159 | 159 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -38,11 +38,11 @@ | |
| 38 | ** The following macros are used to cast pointers to integers and |
| 39 | ** integers to pointers. The way you do this varies from one compiler |
| 40 | ** to the next, so we have developed the following set of #if statements |
| 41 | ** to generate appropriate macros for a wide range of compilers. |
| 42 | ** |
| 43 | ** The correct "ANSI" way to do this is to use the intptr_t type. |
| 44 | ** Unfortunately, that typedef is not available on all compilers, or |
| 45 | ** if it is available, it requires an #include of specific headers |
| 46 | ** that vary from one machine to the next. |
| 47 | ** |
| 48 | ** This code is copied out of SQLite. |
| @@ -112,11 +112,11 @@ | |
| 112 | } |
| 113 | #endif |
| 114 | |
| 115 | /* |
| 116 | ** Create a child process running shell command "zCmd". *ppOut is |
| 117 | ** a FILE that becomes the standard input of the child process. |
| 118 | ** (The caller writes to *ppOut in order to send text to the child.) |
| 119 | ** *ppIn is stdout from the child process. (The caller |
| 120 | ** reads from *ppIn in order to receive input from the child.) |
| 121 | ** Note that *ppIn is an unbuffered file descriptor, not a FILE. |
| 122 | ** The process ID of the child is written into *pChildPid. |
| @@ -124,17 +124,17 @@ | |
| 124 | ** Return the number of errors. |
| 125 | */ |
| 126 | int popen2(const char *zCmd, int *pfdIn, FILE **ppOut, int *pChildPid){ |
| 127 | #ifdef _WIN32 |
| 128 | HANDLE hStdinRd, hStdinWr, hStdoutRd, hStdoutWr, hStderr; |
| 129 | SECURITY_ATTRIBUTES saAttr; |
| 130 | DWORD childPid = 0; |
| 131 | int fd; |
| 132 | |
| 133 | saAttr.nLength = sizeof(saAttr); |
| 134 | saAttr.bInheritHandle = TRUE; |
| 135 | saAttr.lpSecurityDescriptor = NULL; |
| 136 | hStderr = GetStdHandle(STD_ERROR_HANDLE); |
| 137 | if( !CreatePipe(&hStdoutRd, &hStdoutWr, &saAttr, 4096) ){ |
| 138 | win32_fatal_error("cannot create pipe for stdout"); |
| 139 | } |
| 140 | SetHandleInformation( hStdoutRd, HANDLE_FLAG_INHERIT, FALSE); |
| @@ -141,18 +141,18 @@ | |
| 141 | |
| 142 | if( !CreatePipe(&hStdinRd, &hStdinWr, &saAttr, 4096) ){ |
| 143 | win32_fatal_error("cannot create pipe for stdin"); |
| 144 | } |
| 145 | SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE); |
| 146 | |
| 147 | win32_create_child_process(fossil_utf8_to_unicode(zCmd), |
| 148 | hStdinRd, hStdoutWr, hStderr,&childPid); |
| 149 | *pChildPid = childPid; |
| 150 | *pfdIn = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0); |
| 151 | fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0); |
| 152 | *ppOut = _fdopen(fd, "w"); |
| 153 | CloseHandle(hStdinRd); |
| 154 | CloseHandle(hStdoutWr); |
| 155 | return 0; |
| 156 | #else |
| 157 | int pin[2], pout[2]; |
| 158 | *pfdIn = 0; |
| 159 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -38,11 +38,11 @@ | |
| 38 | ** The following macros are used to cast pointers to integers and |
| 39 | ** integers to pointers. The way you do this varies from one compiler |
| 40 | ** to the next, so we have developed the following set of #if statements |
| 41 | ** to generate appropriate macros for a wide range of compilers. |
| 42 | ** |
| 43 | ** The correct "ANSI" way to do this is to use the intptr_t type. |
| 44 | ** Unfortunately, that typedef is not available on all compilers, or |
| 45 | ** if it is available, it requires an #include of specific headers |
| 46 | ** that vary from one machine to the next. |
| 47 | ** |
| 48 | ** This code is copied out of SQLite. |
| @@ -112,11 +112,11 @@ | |
| 112 | } |
| 113 | #endif |
| 114 | |
| 115 | /* |
| 116 | ** Create a child process running shell command "zCmd". *ppOut is |
| 117 | ** a FILE that becomes the standard input of the child process. |
| 118 | ** (The caller writes to *ppOut in order to send text to the child.) |
| 119 | ** *ppIn is stdout from the child process. (The caller |
| 120 | ** reads from *ppIn in order to receive input from the child.) |
| 121 | ** Note that *ppIn is an unbuffered file descriptor, not a FILE. |
| 122 | ** The process ID of the child is written into *pChildPid. |
| @@ -124,17 +124,17 @@ | |
| 124 | ** Return the number of errors. |
| 125 | */ |
| 126 | int popen2(const char *zCmd, int *pfdIn, FILE **ppOut, int *pChildPid){ |
| 127 | #ifdef _WIN32 |
| 128 | HANDLE hStdinRd, hStdinWr, hStdoutRd, hStdoutWr, hStderr; |
| 129 | SECURITY_ATTRIBUTES saAttr; |
| 130 | DWORD childPid = 0; |
| 131 | int fd; |
| 132 | |
| 133 | saAttr.nLength = sizeof(saAttr); |
| 134 | saAttr.bInheritHandle = TRUE; |
| 135 | saAttr.lpSecurityDescriptor = NULL; |
| 136 | hStderr = GetStdHandle(STD_ERROR_HANDLE); |
| 137 | if( !CreatePipe(&hStdoutRd, &hStdoutWr, &saAttr, 4096) ){ |
| 138 | win32_fatal_error("cannot create pipe for stdout"); |
| 139 | } |
| 140 | SetHandleInformation( hStdoutRd, HANDLE_FLAG_INHERIT, FALSE); |
| @@ -141,18 +141,18 @@ | |
| 141 | |
| 142 | if( !CreatePipe(&hStdinRd, &hStdinWr, &saAttr, 4096) ){ |
| 143 | win32_fatal_error("cannot create pipe for stdin"); |
| 144 | } |
| 145 | SetHandleInformation( hStdinWr, HANDLE_FLAG_INHERIT, FALSE); |
| 146 | |
| 147 | win32_create_child_process(fossil_utf8_to_unicode(zCmd), |
| 148 | hStdinRd, hStdoutWr, hStderr,&childPid); |
| 149 | *pChildPid = childPid; |
| 150 | *pfdIn = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0); |
| 151 | fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0); |
| 152 | *ppOut = _fdopen(fd, "w"); |
| 153 | CloseHandle(hStdinRd); |
| 154 | CloseHandle(hStdoutWr); |
| 155 | return 0; |
| 156 | #else |
| 157 | int pin[2], pout[2]; |
| 158 | *pfdIn = 0; |
| 159 |