00001 /* 00002 * Copyright 2004, 2005 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* Copyright (C) 1995 Free Software Foundation, Inc. 00006 This file is part of GNU Fortran libU77 library. 00007 00008 This library is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU Library General Public License as published 00010 by the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 GNU Fortran is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public 00019 License along with GNU Fortran; see the file COPYING.LIB. If 00020 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. */ 00022 00023 #include "config.h" 00024 #include <stdio.h> 00025 #include <errno.h> 00026 #if HAVE_STRING_H 00027 # include <string.h> 00028 #else 00029 # include <strings.h> 00030 #endif 00031 #include "f2c.h" 00032 00033 /* Subroutine */ int 00034 G77_perror_0 (const char *str, const ftnlen Lstr) 00035 { 00036 char buff[1000]; 00037 char *bp, *blast; 00038 00039 /* same technique as `system' -- what's wrong with malloc? */ 00040 blast = buff + (Lstr < 1000 ? Lstr : 1000); 00041 for (bp = buff; bp < blast && *str != '\0';) 00042 *bp++ = *str++; 00043 *bp = '\0'; 00044 perror (buff); 00045 return 0; 00046 }
1.5.6