| | @@ -34,11 +34,11 @@ |
| 34 | 34 | static const char zUnversionedInit[] = |
| 35 | 35 | @ CREATE TABLE IF NOT EXISTS repository.unversioned( |
| 36 | 36 | @ name TEXT PRIMARY KEY, -- Name of the uv file |
| 37 | 37 | @ rcvid INTEGER, -- Where received from |
| 38 | 38 | @ mtime DATETIME, -- timestamp. Seconds since 1970. |
| 39 | | -@ hash TEXT, -- Content hash. NULL if a delete marker |
| 39 | +@ hash TEXT, -- Content hash. NULL if a delete marker |
| 40 | 40 | @ sz INTEGER, -- size of content after decompression |
| 41 | 41 | @ encoding INT, -- 0: plaintext. 1: zlib compressed |
| 42 | 42 | @ content BLOB -- content of the file. NULL if oversized |
| 43 | 43 | @ ) WITHOUT ROWID; |
| 44 | 44 | ; |
| | @@ -290,18 +290,24 @@ |
| 290 | 290 | fossil_fatal("no such uv-file: %Q", zUVFile); |
| 291 | 291 | } |
| 292 | 292 | if( looks_like_binary(&content) ){ |
| 293 | 293 | fossil_fatal("cannot edit binary content"); |
| 294 | 294 | } |
| 295 | +#if defined(_WIN32) || defined(__CYGWIN__) |
| 296 | + blob_add_cr(&content); |
| 297 | +#endif |
| 295 | 298 | blob_write_to_file(&content, zTFile); |
| 296 | 299 | zCmd = mprintf("%s \"%s\"", zEditor, zTFile); |
| 297 | 300 | if( fossil_system(zCmd) ){ |
| 298 | 301 | fossil_fatal("editor aborted: %Q", zCmd); |
| 299 | 302 | } |
| 300 | 303 | fossil_free(zCmd); |
| 301 | 304 | blob_reset(&content); |
| 302 | 305 | blob_read_from_file(&content, zTFile); |
| 306 | +#if defined(_WIN32) || defined(__CYGWIN__) |
| 307 | + blob_to_lf_only(&content); |
| 308 | +#endif |
| 303 | 309 | file_delete(zTFile); |
| 304 | 310 | if( zMtime==0 ) mtime = time(0); |
| 305 | 311 | unversioned_write(zUVFile, &content, mtime); |
| 306 | 312 | db_end_transaction(0); |
| 307 | 313 | blob_reset(&content); |
| 308 | 314 | |