| 1027 | } |
| 1028 | |
| 1029 | static void trim_trailing_spaces(char *buf) |
| 1030 | { |
| 1031 | char *p, *last_space = NULL; |
| 1032 | |
| 1033 | for (p = buf; *p; p++) |
| 1034 | switch (*p) { |
| 1035 | case ' ': |
| 1036 | if (!last_space) |
| 1037 | last_space = p; |
| 1038 | break; |
| 1039 | case '\\': |
| 1040 | p++; |
| 1041 | if (!*p) |
| 1042 | return; |
| 1043 | /* fallthrough */ |
| 1044 | default: |
| 1045 | last_space = NULL; |
| 1046 | } |
| 1047 | |
| 1048 | if (last_space) |
| 1049 | *last_space = '\0'; |
| 1050 | } |
| 1051 | |
| 1052 | /* |
| 1053 | * Given a subdirectory name and "dir" of the current directory, |
no outgoing calls
no test coverage detected