diff -aur fossil-src-1.33.orig/Makefile.in fossil-src-1.33/Makefile.in
--- fossil-src-1.33.orig/Makefile.in	2015-05-23 13:11:31.000000000 +0200
+++ fossil-src-1.33/Makefile.in	2015-05-23 13:53:28.251995600 +0200
@@ -39,7 +39,7 @@
 TCLSH = @TCLSH@
 
 CFLAGS = @CFLAGS@
-LIB =	@LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
+LIB =	@LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ -lws2_32
 BCCFLAGS =	@CPPFLAGS@ $(CFLAGS)
 TCCFLAGS =	@EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
 INSTALLDIR = $(DESTDIR)@prefix@/bin
--- fossil-src-1.33.orig/src/checkin.c	2015-05-23 13:11:31.000000000 +0200
+++ fossil-src-1.33/src/checkin.c	2015-05-23 13:54:26.116750700 +0200
@@ -1217,9 +1208,6 @@
     }
     blob_reset(&fname);
   }
-#if defined(_WIN32)
-  blob_add_cr(pPrompt);
-#endif
   if( blob_size(pPrompt)>0 ) blob_write_to_file(pPrompt, zFile);
   if( zEditor ){
     zCmd = mprintf("%s \"%s\"", zEditor, zFile);
@@ -1277,16 +1265,7 @@
   int parent_rid
 ){
   Blob prompt;
-#if defined(_WIN32) || defined(__CYGWIN__)
-  int bomSize;
-  const unsigned char *bom = get_utf8_bom(&bomSize);
-  blob_init(&prompt, (const char *) bom, bomSize);
-  if( zInit && zInit[0]){
-    blob_append(&prompt, zInit, -1);
-  }
-#else
   blob_init(&prompt, zInit, -1);
-#endif
   blob_append(&prompt,
     "\n"
     "# Enter a commit message for this check-in."
--- fossil-src-1.33.orig/src/db.c	2015-05-23 13:11:31.000000000 +0200
+++ fossil-src-1.33/src/db.c	2015-05-23 13:55:02.561878900 +0200
@@ -1523,20 +1523,18 @@
 #if defined(_WIN32) || defined(__CYGWIN__)
   zHome = fossil_getenv("FOSSIL_HOME");
   if( zHome==0 ){
-    zHome = fossil_getenv("LOCALAPPDATA");
+    zHome = fossil_getenv("HOME");
     if( zHome==0 ){
-      zHome = fossil_getenv("APPDATA");
-      if( zHome==0 ){
-        zHome = fossil_getenv("USERPROFILE");
-        if( zHome==0 ){
-          char *zDrive = fossil_getenv("HOMEDRIVE");
-          char *zPath = fossil_getenv("HOMEPATH");
-          if( zDrive && zPath ) zHome = mprintf("%s%s", zDrive, zPath);
-        }
-      }
+      zHome = fossil_getenv("USERPROFILE");
     }
   }
-  zDbName = mprintf("%//_fossil", zHome);
+  if( zHome==0 ){
+    if( isOptional ) return 0;
+    fossil_panic("cannot locate home directory - please set one of the "
+                 "FOSSIL_HOME, HOME, or USERPROFILE environment "
+                 "variables");
+  }
+  zDbName = mprintf("%//.fossil", zHome);
   fossil_free(zHome);
   return zDbName;
 
@@ -3298,11 +3296,7 @@
   }
 #endif
 
-#if defined(_WIN32) || defined(__CYGWIN__)
-# define LOCALDB_NAME "./_FOSSIL_"
-#else
 # define LOCALDB_NAME "./.fslckout"
-#endif
   db_init_database(LOCALDB_NAME, zLocalSchema, zLocalSchemaVmerge,
 #ifdef FOSSIL_LOCAL_WAL
                    "COMMIT; PRAGMA journal_mode=WAL; BEGIN;",
--- fossil-src-1.33.orig/src/diffcmd.c	2015-05-23 13:11:31.000000000 +0200
+++ fossil-src-1.33/src/diffcmd.c	2015-05-23 13:53:28.276997700 +0200
@@ -606,11 +606,7 @@
   const char *zName;
 
   if( guiDiff ){
-#if defined(_WIN32)
-    zDefault = "WinDiff.exe";
-#else
     zDefault = 0;
-#endif
     zName = "gdiff-command";
   }else{
     zDefault = 0;
--- fossil-src-1.33.orig/src/stash.c	2015-05-23 13:11:31.000000000 +0200
+++ fossil-src-1.33/src/stash.c	2015-05-23 13:53:28.278995500 +0200
@@ -160,13 +160,7 @@
   if( zComment==0 ){
     Blob prompt;                       /* Prompt for stash comment */
     Blob comment;                      /* User comment reply */
-#if defined(_WIN32) || defined(__CYGWIN__)
-    int bomSize;
-    const unsigned char *bom = get_utf8_bom(&bomSize);
-    blob_init(&prompt, (const char *) bom, bomSize);
-#else
     blob_zero(&prompt);
-#endif
     blob_append(&prompt,
        "\n"
        "# Enter a description of what is being stashed.  Lines beginning\n"
--- fossil-src-1.33.orig/src/util.c	2015-05-23 13:11:31.000000000 +0200
+++ fossil-src-1.33/src/util.c	2015-05-23 13:54:26.116750700 +0200
@@ -592,14 +592,6 @@
   if( zEditor==0 ){
     zEditor = fossil_getenv("EDITOR");
   }
-#if defined(_WIN32) || defined(__CYGWIN__)
-  if( zEditor==0 ){
-    zEditor = mprintf("%s\\notepad.exe", fossil_getenv("SYSTEMROOT"));
-#if defined(__CYGWIN__)
-    zEditor = fossil_utf8_to_path(zEditor, 0);
-#endif
-  }
-#endif
   return zEditor;
 }
 
