Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(revision 2931)
+++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(working copy)
@@ -142,6 +142,7 @@
 	private boolean driveOnLeft;
 	private boolean driveOnRight;
 	private final boolean checkRoundabouts;
+	private int reportDeadEnds;
 	private final boolean linkPOIsToWays;
 	private final boolean mergeRoads;
 
@@ -174,7 +175,8 @@
 			NODHeader.setDriveOnLeft(driveOnLeft);
 		driveOnRight = props.getProperty("drive-on-right") != null;
 		checkRoundabouts = props.getProperty("check-roundabouts") != null;
-
+		reportDeadEnds = props.getProperty("report-dead-ends", 1); 
+		
 		LineAdder overlayAdder = style.getOverlays(lineAdder);
 		if (overlayAdder != null)
 			lineAdder = overlayAdder;
@@ -264,7 +266,17 @@
 					if (checkFixmeCoords(way))
 						way.addTag("mkgmap:dead-end-check", "false");
 				}
-		    	
+				String oneWay = way.getTag("oneway");
+				if("-1".equals(oneWay) || "reverse".equals(oneWay)) {
+					// it's a oneway street in the reverse direction
+					// so reverse the order of the nodes and change
+					// the oneway tag to "yes"
+					way.reverse();
+					way.addTag("oneway", "yes");
+					if("roundabout".equals(way.getTag("junction")))
+						log.warn("Roundabout", way.getId(), "has reverse oneway tag (" + way.getPoints().get(0).toOSMURL() + ")");
+				}
+
 		    	roads.add(way);
 		    	roadTypes.add(new GType(foundType));
 		    }
@@ -531,7 +543,7 @@
 		removeObsoletePoints();
 		writeOSM("roads_post_rem_obsolete_points", roads);
 		printBadAngles("bad_angles_finish");
-		// make sure that copies of modified roads are have equal points 
+		// make sure that copies of modified roads are have equal points
 		for (int i = 0; i < lines.size(); i++){
 			Way line = lines.get(i);
 			if (deletedRoads.contains(line.getId())){
@@ -1089,17 +1101,6 @@
 			return;
 		}
 
-		String oneWay = way.getTag("oneway");
-		if("-1".equals(oneWay) || "reverse".equals(oneWay)) {
-			// it's a oneway street in the reverse direction
-			// so reverse the order of the nodes and change
-			// the oneway tag to "yes"
-			way.reverse();
-			way.addTag("oneway", "yes");
-			if("roundabout".equals(way.getTag("junction")))
-				log.warn("Roundabout", way.getId(), "has reverse oneway tag (" + way.getPoints().get(0).toOSMURL() + ")");
-		}
-
 		checkRoundabout(way);
 		addNodesForRestrictions(way);
 
@@ -1917,6 +1918,8 @@
 	private void findUnconnectedRoads(){
 		
 		Map<Coord, HashSet<Way>> connectors = new IdentityHashMap<Coord, HashSet<Way>>(roads.size()*2);
+		Map<Coord, Coord> selfConnectors = new IdentityHashMap<Coord, Coord>();
+		
 		// collect nodes that might connect roads
 		long lastId = 0;
 		for (Way way :roads){
@@ -1930,7 +1933,9 @@
 						ways = new HashSet<Way>(4);
 						connectors.put(p, ways);
 					}
-					ways.add(way);
+					boolean wasNew = ways.add(way);
+					if (!wasNew && reportDeadEnds > 0)
+						selfConnectors.put(p,p);
 				}
 			}
 		}
@@ -1938,6 +1943,57 @@
 		// find roads that are not connected
 		for (int i = 0; i < roads.size(); i++){
 			Way way = roads.get(i);
+			if(reportDeadEnds > 0){
+				// report dead ends of oneway roads 
+				if (way.isBoolTag("oneway") && !way.isNotBoolTag("mkgmap:dead-end-check")) {
+					if (way.hasIdenticalEndPoints())
+						continue;
+					int pos = 0;
+					while(true){
+						boolean isDeadEnd = true;
+						boolean isDeadEndOfMultipleWays = true;
+						Coord p = way.getPoints().get(pos);
+						if (bbox.contains(p) == false || p.getOnBoundary())
+							isDeadEnd = false;
+						else if (p.getHighwayCount() < 2){
+							isDeadEndOfMultipleWays = false;
+						} else {
+							HashSet<Way> ways = connectors.get(p);
+							if (ways.size() == 1)
+								isDeadEndOfMultipleWays = false;
+							if (selfConnectors.containsKey(p))
+								isDeadEnd = false; // this is a P-shaped oneway
+							for (Way connectedWay: ways){
+								if (!isDeadEnd)
+									break;
+								if (way == connectedWay)
+									continue;
+								if (connectedWay.hasIdenticalEndPoints() || connectedWay.isBoolTag("oneway") == false)
+									isDeadEnd = false;
+								else {
+									Coord pOther;
+									if (pos != 0)
+										pOther = connectedWay.getPoints().get(connectedWay.getPoints().size()-1);
+									else
+										pOther = connectedWay.getPoints().get(0);
+									if (p != pOther){
+										// way is connected to a point on a oneway which allows going on
+										isDeadEnd = false;
+									}
+								}
+							}
+						}
+						
+						if (isDeadEnd && (isDeadEndOfMultipleWays || reportDeadEnds > 1)){
+							log.warn("Oneway road " + way.getId() + " with tags " + way.toTagString() + ((pos==0) ? " comes from":" goes to") + " nowhere at " + p.toOSMURL());
+						}
+						if (pos != 0)
+							break;
+						pos = way.getPoints().size()-1; 
+					}
+				}
+			}
+
 			String check_type = way.getTag("mkgmap:set_unconnected_type");
 			if (check_type != null){
 				boolean isConnected = false;
