# # patch "ChangeLog" # from [efc8c510620af16e255ce6809d32dabbd93f5d3a] # to [484a145eaac0500d4fc2a0938b9ca924ef565ef3] # # patch "txt2c.cc" # from [f86b48a6d189de4847a70a62aced0402258b73d2] # to [af464696310692534add8c0ac8e078b622b98630] # ======================================================================== --- ChangeLog efc8c510620af16e255ce6809d32dabbd93f5d3a +++ ChangeLog 484a145eaac0500d4fc2a0938b9ca924ef565ef3 @@ -1,5 +1,9 @@ 2005-11-28 Nathaniel Smith + * txt2c.cc (main): Work correctly even on empty files. + +2005-11-28 Nathaniel Smith + * schema_migration.cc: Provide more feedback while 'db migrate' is running. ======================================================================== --- txt2c.cc f86b48a6d189de4847a70a62aced0402258b73d2 +++ txt2c.cc af464696310692534add8c0ac8e078b622b98630 @@ -12,6 +12,7 @@ } bool do_strip_trailing = false; + bool do_static = false; string static_decl("static "); int i = 1; if (string(argv[i]) == "--strip-trailing") @@ -21,6 +22,7 @@ } if (string(argv[i]) == "--no-static") { + do_static = true; static_decl = ""; i++; } @@ -45,7 +47,7 @@ } cout << "// DO NOT EDIT\n" - << "// this file is automatically generated from " << argv[do_strip_trailing?2:1] << ",\n" + << "// this file is automatically generated from " << argv[1 + do_strip_trailing + do_static] << ",\n" << "// any changes you make will be destroyed when it is regenerated\n" << "\n\n" << static_decl @@ -54,9 +56,8 @@ for (unsigned int i = 0; i < dat.size(); ++i) { if (i == 0) cout << "\t"; - else if (i % 20 == 0) cout << ",\n\t"; - else cout << ", "; - cout << static_cast(dat[i]); + else if (i % 20 == 0) cout << "\n\t"; + cout << static_cast(dat[i]) << ", "; } - cout << ", 0\n};\n"; + cout << "0\n};\n"; }