wcmd: some more formatted output fixes
Rein Klazes
wijn at wanadoo.nl
Thu Dec 1 16:41:37 CST 2005
Hi,
Changelog:
programs/wcmd : batch.c, builtins.c, wcmdmain.c
Avoid formatted output in a few more places where formatting is not
really needed and output could be large enough to be truncated .
Rein.
-------------- next part --------------
--- wine/programs/wcmd/batch.c 2005-03-29 10:24:21.000000000 +0200
+++ mywine/programs/wcmd/batch.c 2005-12-01 18:44:49.000000000 +0100
@@ -94,7 +94,9 @@ BATCH_CONTEXT *prev_context;
while (WCMD_fgets (string, sizeof(string), h)) {
if (strlen(string) == MAXSTRING -1)
- WCMD_output("Line in Batch processing possible truncated. Using:\n%s\n",string);
+ WCMD_output_asis( "Line in Batch processing possible truncated. Using:\n");
+ WCMD_output_asis( string);
+ WCMD_output_asis( "\n");
if (string[0] != ':') { /* Skip over labels */
WCMD_batch_command (string);
}
@@ -179,7 +181,8 @@ int i;
/* Show prompt before batch line IF echo is on */
if (echo_mode && (line[0] != '@')) {
WCMD_show_prompt();
- WCMD_output ("%s\n", cmd2);
+ WCMD_output_asis ( cmd2);
+ WCMD_output_asis ( "\n");
}
WCMD_process_command (cmd2);
--- wine/programs/wcmd/builtins.c 2005-12-01 19:30:31.000000000 +0100
+++ mywine/programs/wcmd/builtins.c 2005-12-01 20:08:00.000000000 +0100
@@ -827,7 +827,10 @@ char buffer[1048];
*/
status = GetEnvironmentVariable(s, buffer, sizeof(buffer));
if (status) {
- WCMD_output("%s=%s\n", s, buffer);
+ WCMD_output_asis( s);
+ WCMD_output_asis( "=");
+ WCMD_output_asis( buffer);
+ WCMD_output_asis( "\n");
} else {
WCMD_output ("Environment variable %s not defined\n", s);
}
@@ -856,7 +859,9 @@ DWORD status;
if (strlen(param1) == 0) {
status = GetEnvironmentVariable ("PATH", string, sizeof(string));
if (status != 0) {
- WCMD_output ("PATH=%s\n", string);
+ WCMD_output_asis ( "PATH=");
+ WCMD_output_asis ( string);
+ WCMD_output_asis ( "\n");
}
else {
WCMD_output ("PATH not found\n");
--- wine/programs/wcmd/wcmdmain.c 2005-12-01 19:30:31.000000000 +0100
+++ mywine/programs/wcmd/wcmdmain.c 2005-12-01 19:28:02.000000000 +0100
@@ -698,7 +698,7 @@ char *p, *q;
*q = '\0';
}
}
- WCMD_output (out_string);
+ WCMD_output_asis (out_string);
}
/****************************************************************************
@@ -720,9 +720,9 @@ int status;
error_code, GetLastError());
return;
}
- WCMD_output (lpMsgBuf);
+ WCMD_output_asis (lpMsgBuf);
LocalFree ((HLOCAL)lpMsgBuf);
- WCMD_output (newline);
+ WCMD_output_asis (newline);
return;
}
More information about the wine-patches
mailing list