• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

POSIX.1 National Language Support API for MinGW


Commit MetaInfo

修订版8f5685cd045a2544f39a1394090737203a5c94c0 (tree)
时间2007-05-15 04:55:09
作者Keith Marshall <keithmarshall@user...>
CommiterKeith Marshall

Log Message

* mcsource.c (mc_source): Close input_fd' prior to every use of return', when returning abnormally.

更改概述

差异

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
11 2007-05-14 Keith Marshall <keithmarshall@users.sourceforge.net>
22
3+ * mcsource.c (mc_source): Close `input_fd' prior to every use
4+ of `return', when returning abnormally.
5+
6+2007-05-14 Keith Marshall <keithmarshall@users.sourceforge.net>
7+
38 Support all escape sequences required by POSIX 1003.1.
49
510 * mcsource.c (OCTAL_SEQUENCE_DECODE): New manifest constant.
--- a/mcsource.c
+++ b/mcsource.c
@@ -9,7 +9,7 @@
99 * used internally by `gencat', to compile message dictionaries.
1010 *
1111 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
12- * Last modification: 12-May-2007
12+ * Last modification: 14-May-2007
1313 *
1414 *
1515 * This is free software. It is provided AS IS, in the hope that it may
@@ -255,7 +255,10 @@ struct msgdict *mc_source( const char *input )
255255
256256 dfprintf(( stderr, "\n%s:new source file\n%s:", input, input ));
257257 if( (messages = mc_malloc( headroom = mc_workspace_wanted( fd ))) == NULL )
258+ {
259+ close( input_fd );
258260 return NULL;
261+ }
259262
260263 msgloc = (off_t)(0);
261264 while( (fd >= 0) && ((count = read( fd, buf, sizeof( buf ) )) > 0) )
@@ -490,6 +493,7 @@ struct msgdict *mc_source( const char *input )
490493 */
491494 dfputc(( '\n', stderr ));
492495 gencat_errno = mc_errout( FATAL( MSG_SETNUM_NOT_INCR ), setnum, accumulator );
496+ close( input_fd );
493497 return NULL;
494498 }
495499 break;
@@ -601,6 +605,7 @@ struct msgdict *mc_source( const char *input )
601605 */
602606 dfputc(( '\n', stderr ));
603607 gencat_errno = mc_errout( FATAL( MSG_MSGNUM_NOT_INCR ), msgnum, accumulator );
608+ close( input_fd );
604609 return NULL;
605610 }
606611 status |= ( MSGTEXT | ENCODED );
@@ -836,6 +841,7 @@ struct msgdict *mc_source( const char *input )
836841 if( (messages = realloc( messages, msgloc + headroom )) == NULL )
837842 {
838843 gencat_errno = mc_errout( FATAL( MSG_OUT_OF_MEMORY ));
844+ close( input_fd );
839845 return NULL;
840846 }
841847 }