diff options
author | Arun Kuruvila <arun.kuruvila@oracle.com> | 2014-10-21 16:25:35 +0530 |
---|---|---|
committer | Arun Kuruvila <arun.kuruvila@oracle.com> | 2014-10-21 16:25:35 +0530 |
commit | 349ac8c9b3bec7f56922ab55a2504e225b03ba87 (patch) | |
tree | 4977740c19be4c5ecc3f3c3d1c049817bf867a68 /extra/replace.c | |
parent | 5c41d52904be50c77b204a8450829fbeacbf080f (diff) | |
download | mariadb-git-349ac8c9b3bec7f56922ab55a2504e225b03ba87.tar.gz |
Bug #16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5
Description:- Replace, the string replacement utility fails
on the windows platform.
Analysis:- The utility takes files and multiple string
pairs as input. In the windows platform, the utility maps
the standard input incorrectly (Considers 0 as the fd for
standard input instead of 2048 on windows). Hence when the
input file is supplied to the utility due to the incorrect
mapping, a bad file descriptor error is generated causing
the utility to exit with an error.
Fix:- "my_fileno()" is used for getting the correct file
despscriptor for standard input.
Diffstat (limited to 'extra/replace.c')
-rw-r--r-- | extra/replace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/extra/replace.c b/extra/replace.c index 53bc1fd925a..53d9830ad40 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -1020,7 +1020,7 @@ FILE *in,*out; updated=retain=0; reset_buffer(); - while ((error=fill_buffer_retaining(fileno(in),retain)) > 0) + while ((error=fill_buffer_retaining(my_fileno(in),retain)) > 0) { end_of_line=buffer ; buffer[bufbytes]=0; /* Sentinel */ |